diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-05 12:45:31 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-05 12:45:31 (GMT) |
| commit | 7c8eaad1bf48f479c0440e6f39b6740b58956520 (patch) | |
| tree | 9760918800da3d412bbd649b47f7fe611a446263 /Lib/test | |
| parent | 2dd131d5358d155dbc7bea40d6c993b9530f98f3 (diff) | |
| download | cpython-7c8eaad1bf48f479c0440e6f39b6740b58956520.zip cpython-7c8eaad1bf48f479c0440e6f39b6740b58956520.tar.gz cpython-7c8eaad1bf48f479c0440e6f39b6740b58956520.tar.bz2 | |
Merged revisions 80777 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r80777 | victor.stinner | 2010-05-05 14:40:49 +0200 (mer., 05 mai 2010) | 3 lines
Issue #8313: traceback.format_exception_only() encodes unicode message to
ASCII with backslashreplace error handler if str(value) failed
........
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_traceback.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 1c067d7..6ef70a6 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -168,6 +168,15 @@ def test(): err = traceback.format_exception_only(None, None) self.assertEqual(err, ['None\n']) + def test_unicode(self): + err = AssertionError('\xff') + lines = traceback.format_exception_only(type(err), err) + self.assertEqual(lines, ['AssertionError: \xff\n']) + + err = AssertionError(u'\xe9') + lines = traceback.format_exception_only(type(err), err) + self.assertEqual(lines, ['AssertionError: \\xe9\n']) + class TracebackFormatTests(unittest.TestCase): |
