From a563aecda09d01b4ecd278315360148de6a36be9 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 22 Oct 2013 10:59:09 +0200 Subject: fix issue129: tox now uses Popen(..., universal_newlines=True) to force creation of unicode stdout/stderr streams. fixes a problem on specific platform configs when creating virtualenvs with Python3.3. Thanks Jorgen Sch?fer or investigation and solution sketch. --- CHANGELOG | 5 +++++ tox/_cmdline.py | 4 +++- tox/_pytestplugin.py | 1 + tox/_venv.py | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6661295..d153797 100755 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ 1.6.2.dev --------- +- fix issue129: tox now uses Popen(..., universal_newlines=True) to force + creation of unicode stdout/stderr streams. fixes a problem on specific + platform configs when creating virtualenvs with Python3.3. Thanks Jorgen Schäfer + or investigation and solution sketch. + - fix issue128: enable full substitution in install_command, thanks for the PR to Ronald Evers diff --git a/tox/_cmdline.py b/tox/_cmdline.py index 24e47ba..5407b4a 100644 --- a/tox/_cmdline.py +++ b/tox/_cmdline.py @@ -93,7 +93,8 @@ class Action(object): if cwd is None: # XXX cwd = self.session.config.cwd cwd = py.path.local() - popen = self._popen(args, cwd, env=env, stdout=f, stderr=STDOUT) + popen = self._popen(args, cwd, env=env, + stdout=f, stderr=STDOUT) popen.outpath = outpath popen.args = [str(x) for x in args] popen.cwd = cwd @@ -150,6 +151,7 @@ class Action(object): if env is None: env = os.environ.copy() return self.session.popen(args, shell=False, cwd=str(cwd), + universal_newlines=True, stdout=stdout, stderr=stderr, env=env) diff --git a/tox/_pytestplugin.py b/tox/_pytestplugin.py index 6c90c8d..4958617 100644 --- a/tox/_pytestplugin.py +++ b/tox/_pytestplugin.py @@ -130,6 +130,7 @@ def pytest_funcarg__mocksession(request): def make_emptydir(self, path): pass def popen(self, args, cwd, shell=None, + universal_newlines=False, stdout=None, stderr=None, env=None): pm = pcallMock(args, cwd, env, stdout, stderr, shell) self._pcalls.append(pm) diff --git a/tox/_venv.py b/tox/_venv.py index ec7ada2..cb53ec0 100644 --- a/tox/_venv.py +++ b/tox/_venv.py @@ -228,7 +228,7 @@ class VirtualEnv(object): args = [self.envconfig.envpython, str(setup_py), '--name'] output = action.popen(args, cwd=setupdir, redirect=False, returnout=True) - name = output.strip().decode('utf-8') + name = output.strip() egg_info = setupdir.join('.'.join((name, 'egg-info'))) for conf_file in (setup_py, setup_cfg): if (not egg_info.check() or (conf_file.check() -- cgit v1.2.1