Author doerwalter
Recipients doerwalter, vstinner
Date 2010-11-05.15:01:32
SpamBayes Score 1.70697e-13
Marked as misclassified No
Message-id <>
It seems that on Python 3 (i.e. the py3k branch) can not handle source that includes Unicode characters. Running the test suite with code coverage info via

   ./python Lib/test/ -T -N -uurlfetch,largefile,network,decimal

sometimes fails with the following exception:

Traceback (most recent call last):
  File "Lib/test/", line 1500, in <module>
  File "Lib/test/", line 696, in main
    r.write_results(show_missing=True, summary=True, coverdir=coverdir)
  File "/home/coverage/python/Lib/", line 319, in write_results
    lnotab, count)
  File "/home/coverage/python/Lib/", line 369, in write_results_file
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in
position 30: ordinal not in range(128)

The script that produces code coverage info on uses this feature to generate code coverage info.

Applying the attached patch (i.e. specifying an explicit encoding when opening the output file) fixes the problem.
Date User Action Args
2010-11-05 15:01:38doerwaltersetrecipients: + doerwalter, vstinner
2010-11-05 15:01:38doerwaltersetmessageid: <>
2010-11-05 15:01:34doerwalterlinkissue10329 messages
2010-11-05 15:01:33doerwaltercreate