Message102368
>>> import unittest
>>> class Foo(unittest.TestCase):
... def test_fffd(self): self.assertEqual(u'\ufffd', u'\ufffd\ufffd')
...
>>> unittest.main(exit=False)
F
======================================================================
FAIL: test_fffd (__main__.Foo)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<stdin>", line 2, in test_fffd
AssertionError: <unprintable AssertionError object>
----------------------------------------------------------------------
Ran 1 test in 0.001s
The problem with creating unicode tracebacks is that they could fail when being output on terminals not capable of showing the full range of unicode characters (the default terminal on Windows is CP1252).
This can already happen with Unicode messages that aren't part of the traceback.
Detecting the 'unprintable' message before calling into traceback and replacing it with the repr of the unicode is one possibility. |
|
Date |
User |
Action |
Args |
2010-04-05 10:56:29 | michael.foord | set | recipients:
+ michael.foord, ezio.melotti |
2010-04-05 10:56:29 | michael.foord | set | messageid: <1270464989.56.0.215414826495.issue8313@psf.upfronthosting.co.za> |
2010-04-05 10:56:27 | michael.foord | link | issue8313 messages |
2010-04-05 10:56:26 | michael.foord | create | |
|