Tarek Ziadé <[email protected]> added the comment:
This is not a bug in distutils, but how print works when executed
through subprocess.
here's a demo:
Create a file called "test.py" with:
# -*- coding: utf8 -*-
print u'éééé'
Now another one called "test2.py" with:
import subprocess
subprocess.Popen('python test.py', stdout=subprocess.PIPE,
shell=True).stdout.read()
Now launch test2:
$ python test2.py
Traceback (most recent call last):
File "test.py", line 2, in <module>
print u'éééé'
UnicodeEncodeError: 'ascii' codec can't encode characters in position
0-3: ordinal not in range(128)
I don't know about the internals of print, and I am not sure this is a
bug, so I'll put Marc-André in the loop.
----------
assignee: tarek ->
components: +Unicode -Distutils
nosy: +lemburg
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue6166>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com