Skip to content

Commit

Permalink
Fix for issue pypa#457
Browse files Browse the repository at this point in the history
  • Loading branch information
atykhonov committed Oct 30, 2013
1 parent 9263809 commit b3b51cc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,15 +830,15 @@ def call_subprocess(cmd, show_stdout=True,
remove_from_env=None):
cmd_parts = []
for part in cmd:
if len(part) > 45:
part = part[:20]+"..."+part[-20:]
if ' ' in part or '\n' in part or '"' in part or "'" in part:
part = '"%s"' % part.replace('"', '\\"')
if hasattr(part, 'decode'):
try:
part = part.decode(sys.getdefaultencoding())
except UnicodeDecodeError:
part = part.decode(sys.getfilesystemencoding())
if len(part) > 45:
part = part[:20]+"..."+part[-20:]
if ' ' in part or '\n' in part or '"' in part or "'" in part:
part = '"%s"' % part.replace('"', '\\"')
cmd_parts.append(part)
cmd_desc = ' '.join(cmd_parts)
if show_stdout:
Expand Down Expand Up @@ -1385,7 +1385,7 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
py_executable = '"%s"' % py_executable
# NOTE: keep this check as one line, cmd.exe doesn't cope with line breaks
cmd = [py_executable, '-c', 'import sys;out=sys.stdout;'
'getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))']
'getattr(out, "buffer", out).write(sys.prefix)']
logger.info('Testing executable with %s %s "%s"' % tuple(cmd))
try:
proc = subprocess.Popen(cmd,
Expand Down

0 comments on commit b3b51cc

Please sign in to comment.