We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b4fa721 + 7b826d6 commit ee7446fCopy full SHA for ee7446f
utils/incrparse/test_util.py
@@ -23,7 +23,12 @@ def escapeCmdArg(arg):
23
def run_command(cmd):
24
if sys.version_info[0] < 3:
25
cmd = list(map(lambda s: s.encode('utf-8'), cmd))
26
- print(' '.join([escapeCmdArg(arg) for arg in cmd]))
+ cmdStr = ' '.join([escapeCmdArg(arg) for arg in cmd])
27
+ if not sys.stdout.encoding.lower().startswith('utf'):
28
+ # stdout doesn't support Unicode characters, encode them into an escape
29
+ # sequence
30
+ cmdStr = cmdStr.encode('utf-8')
31
+ print(cmdStr)
32
if sys.version_info[0] < 3 or platform.system() == 'Windows':
33
return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
34
else:
0 commit comments