[issue6135] subprocess seems to use local encoding and give no choice
Joseph Perry
report at bugs.python.org
Thu Jan 17 23:14:24 CET 2013
Joseph Perry added the comment:
I've found a workaround by specifying the enviroment variable:
my_env = os.environ
my_env['PYTHONIOENCODING'] = 'utf-8'
p = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, env=my_env)
I've attached an example script for testing. It calls itself recursively 10 times.
Pleased note the 'fix' variable.
----------
nosy: +berwin22
Added file: http://bugs.python.org/file28760/subProcessTest.py
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6135>
_______________________________________
More information about the Python-bugs-list
mailing list