[issue10329] trace.py and unicode in Python 3

Antoine Pitrou report at bugs.python.org
Sun Nov 7 15:31:41 CET 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

For the record, the test failure can reproduced by the following:

$ LANG=C ./python -m test.regrtest test_imp test_trace
[1/2] test_imp
[2/2] test_trace
/home/antoine/py3k/__svn__/Lib/unittest/case.py:402: ResourceWarning: unclosed file <_io.TextIOWrapper name='@test_11986_tmp/os.cover' encoding='ANSI_X3.4-1968'>
  result.addError(self, sys.exc_info())
test test_trace failed -- Traceback (most recent call last):
  File "/home/antoine/py3k/__svn__/Lib/test/test_trace.py", line 296, in test_coverage
    self._coverage(tracer)
  File "/home/antoine/py3k/__svn__/Lib/test/test_trace.py", line 291, in _coverage
    r.write_results(show_missing=True, summary=True, coverdir=TESTFN)
  File "/home/antoine/py3k/__svn__/Lib/trace.py", line 334, in write_results
    lnotab, count)
  File "/home/antoine/py3k/__svn__/Lib/trace.py", line 384, in write_results_file
    outfile.write(line.expandtabs(8))
UnicodeEncodeError: 'ascii' codec can't encode character '\xa0' in position 5: ordinal not in range(128)

1 test OK.
1 test failed:
    test_trace


There's a strange interaction between test_imp and test_trace, it seems. Not sure why.

----------
stage: unit test needed -> needs patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10329>
_______________________________________


More information about the Python-bugs-list mailing list