From a0fe77254c0f8e87f2ce0a17d85fa7c7ab97ebf2 Mon Sep 17 00:00:00 2001 From: Anthony Scopatz Date: Fri, 15 Jan 2016 17:35:12 -0500 Subject: [PATCH] capturing redirection fix --- CHANGELOG.rst | 2 ++ xonsh/built_ins.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 60ec1fb3e..7f2eec0c3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -47,6 +47,8 @@ None * Fixed issue with job management if a TTY existed but was not controlled by the process, posix only. * Jupyter kernel no longer times out when using foreign shells on startup. +* Capturing redirections, e.g. ``$(echo hello > f.txt)``, no longer fails + with a decoding error. **Security:** diff --git a/xonsh/built_ins.py b/xonsh/built_ins.py index 2696ebbee..e53126897 100644 --- a/xonsh/built_ins.py +++ b/xonsh/built_ins.py @@ -625,7 +625,7 @@ def run_subproc(cmds, captured=True): hist.last_cmd_rtn = prev_proc.returncode if write_target is None: # get output - output = '' + output = b'' if prev_proc.stdout not in (None, sys.stdout): output = prev_proc.stdout.read() if captured: