cpython: 580d536cc910 (original) (raw)

--- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -927,6 +927,50 @@ class EscapeDecodeTest(unittest.TestCase def test_empty(self): self.assertEqual(codecs.escape_decode(""), (b"", 0))

+

+

+ class RecodingTest(unittest.TestCase): def test_recoding(self): f = io.BytesIO()

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,8 @@ What's New in Python 3.3.1? Core and Builtins ----------------- +- Issue #16975: Fix error handling bug in the escape-decode bytes decoder. +

--- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -480,6 +480,10 @@ PyObject *PyBytes_DecodeEscape(const cha errors); goto failed; }