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 michael.foord
Recipients ezio.melotti, michael.foord
Date 2010-04-05.10:56:26
SpamBayes Score 0.00022840811
Marked as misclassified No
Message-id <1270464989.56.0.215414826495.issue8313@psf.upfronthosting.co.za>
In-reply-to
Content
>>> 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.
History
Date User Action Args
2010-04-05 10:56:29michael.foordsetrecipients: + michael.foord, ezio.melotti
2010-04-05 10:56:29michael.foordsetmessageid: <1270464989.56.0.215414826495.issue8313@psf.upfronthosting.co.za>
2010-04-05 10:56:27michael.foordlinkissue8313 messages
2010-04-05 10:56:26michael.foordcreate