[pypy-commit] pypy default: Popen.communicate() returns bytes if no encoding was specified.

rlamy pypy.commits at gmail.com
Tue May 2 11:51:30 EDT 2017


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: 
Changeset: r91165:5218685456b2
Date: 2017-04-02 17:09 +0200
http://bitbucket.org/pypy/pypy/changeset/5218685456b2/

Log:	Popen.communicate() returns bytes if no encoding was specified.
	(grafted from 1fb74e1664446090361a9fe4ec11a67740e13d2d)

diff --git a/rpython/tool/runsubprocess.py b/rpython/tool/runsubprocess.py
--- a/rpython/tool/runsubprocess.py
+++ b/rpython/tool/runsubprocess.py
@@ -49,7 +49,7 @@
     pipe = Popen(args, stdout=PIPE, stderr=PIPE, shell=shell, env=env, cwd=cwd)
     stdout, stderr = pipe.communicate()
     if (sys.platform == 'win32' and pipe.returncode == 1 and 
-        'is not recognized' in stderr):
+        b'is not recognized' in stderr):
         # Setting shell=True on windows messes up expected exceptions
         raise EnvironmentError(stderr)
     return pipe.returncode, stdout, stderr


More information about the pypy-commit mailing list