This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tarek
Recipients lemburg, srid, tarek
Date 2009-06-01.20:41:47
SpamBayes Score 1.5793397e-09
Marked as misclassified No
Message-id <1243888909.28.0.00108155484758.issue6166@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-06-01 20:41:49tareksetrecipients: + tarek, lemburg, srid
2009-06-01 20:41:49tareksetmessageid: <1243888909.28.0.00108155484758.issue6166@psf.upfronthosting.co.za>
2009-06-01 20:41:48tareklinkissue6166 messages
2009-06-01 20:41:47tarekcreate