Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix crash on constructing log message with non-ASCII paths

  • Loading branch information...
commit 7d22b8f753e3a0203a7061a5359fadd847024ea1 1 parent f23e111
@gthb gthb authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 virtualenv.py
View
7 virtualenv.py
@@ -844,8 +844,13 @@ def call_subprocess(cmd, show_stdout=True,
part = part[:20]+"..."+part[-20:]
if ' ' in part or '\n' in part or '"' in part or "'" in part:
part = '"%s"' % part.replace('"', '\\"')
+ if isinstance(part, str):
+ try:
+ part = part.decode(sys.getdefaultencoding())
+ except UnicodeDecodeError:
+ part = part.decode(sys.getfilesystemencoding())
cmd_parts.append(part)
- cmd_desc = ' '.join(cmd_parts)
+ cmd_desc = u' '.join(cmd_parts)
if show_stdout:
stdout = None
else:
Please sign in to comment.
Something went wrong with that request. Please try again.