Open wooyek opened 8 years ago
I ran into the same issue and I think the problem is that the environment strings are being coded as bytes instead of strings.
I'm going to test that and create a pull request.
Same problem, and I can confirm.
>>> subprocess.check_output(["cmd"], env=dict(list(os.environ.items()) + [(b'HGENCODING', b'utf-8')]))
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
subprocess.check_output(["cmd"], env=dict(list(os.environ.items()) + [(b'HGENCODING', b'utf-8')]))
File "C:\Users\davidfallah\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 626, in check_output
**kwargs).stdout
File "C:\Users\davidfallah\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\davidfallah\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "C:\Users\davidfallah\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
TypeError: environment can only contain strings
>>> subprocess.check_output(["cmd"], env=dict(list(os.environ.items()) + [('HGENCODING', 'utf-8')]))
b'Microsoft Windows [Version 6.1.7601]\r\nCopyright (c) 2009 Microsoft Corporation. All rights reserved.\r\n\r\nC:\\Users\\davidfallah\\AppData\\Local\\Programs\\Python\\Python35-32>'
subprocess.check_output(["cmd"], env=dict(list(os.environ.items()) + [(b'HGENCODING', b'utf-8')]))
'Microsoft Windows [Version 6.1.7601]\r\nCopyright (c) 2009 Microsoft Corporation. All rights reserved.\r\n\r\nC:\\Python27>'
>>> subprocess.check_output(["cmd"], env=dict(list(os.environ.items()) + [('HGENCODING', 'utf-8')]))
'Microsoft Windows [Version 6.1.7601]\r\nCopyright (c) 2009 Microsoft Corporation. All rights reserved.\r\n\r\nC:\\Python27>'
is there any resolution/work around please?
Same issue here. Is there any news ?
The
commit
command after is failing on windows and PY3. Can anybody help with this?