diff --git a/xonsh/procs/pipelines.py b/xonsh/procs/pipelines.py index a224b6b5c..ddf507f5e 100644 --- a/xonsh/procs/pipelines.py +++ b/xonsh/procs/pipelines.py @@ -257,11 +257,6 @@ class CommandPipeline: if hasattr(stdout, "buffer"): stdout = stdout.buffer if stdout is not None and not isinstance(stdout, self.nonblocking): - # try: - # fn = stdout.fileno() - # except: - # fn=0 - # print('NonBlockingFDReader', spec.alias, spec.cmd, stdout, fn, file=sys.__stdout__) stdout = NonBlockingFDReader(stdout.fileno(), timeout=timeout) if ( not stdout @@ -394,7 +389,6 @@ class CommandPipeline: # write to stdout line ASAP, if needed if stream: if stdout_has_buffer: - # self._std_is_binary buf_mode = getattr(sys.stdout.buffer, "mode", None) if (buf_mode and "b" in buf_mode) or getattr( sys.stdout.buffer, "_std_is_binary", False diff --git a/xonsh/procs/proxies.py b/xonsh/procs/proxies.py index faae0fe2a..5e6f5e61e 100644 --- a/xonsh/procs/proxies.py +++ b/xonsh/procs/proxies.py @@ -441,6 +441,7 @@ class ProcProxyThread(threading.Thread): # stdout if self.c2pwrite != -1: if xt.ON_WINDOWS: + # This split was made during solving #5645. We need more eyes to improve this logic for Windows. open_stdout = open(self.c2pwrite, "wb", -1) else: open_stdout = open(self.c2pwrite, "wb", -1) if isinstance(self.stdout, int) or self.stdout is None else self.stdout @@ -456,6 +457,7 @@ class ProcProxyThread(threading.Thread): sp_stderr = sp_stdout elif self.errwrite != -1: if xt.ON_WINDOWS: + # This split was made during solving #5645. We need more eyes to improve this logic for Windows. open_stderr = open(self.errwrite, "wb", -1) else: open_stderr = open(self.errwrite, "wb", -1) if isinstance(self.stderr, int) or self.stderr is None else self.stderr @@ -527,13 +529,7 @@ class ProcProxyThread(threading.Thread): handles = [self.stdout, self.stderr] else: handles = [sp_stdout, sp_stderr] - # # if self.stdout: - # # print('Close', self.stdout, self.stdout.fileno(), file=sys.__stdout__) for handle in handles: - # if isinstance( - # getattr(handle, "name", None), str - # ) and handle.name.startswith("/"): - # continue safe_fdclose(handle, cache=self._closed_handle_cache) def _wait_and_getattr(self, name): diff --git a/xonsh/procs/readers.py b/xonsh/procs/readers.py index 8c061ae38..16bd8bf0d 100644 --- a/xonsh/procs/readers.py +++ b/xonsh/procs/readers.py @@ -415,9 +415,7 @@ def safe_fdclose(handle, cache=None): pass else: try: - # print(f'close {handle}') handle.close() - # print(f'/close {handle}') except OSError: status = False if cache is not None: