changeset: 90725:8ee2b73cda7a user: Victor Stinner date: Fri May 16 14:46:20 2014 +0200 files: Lib/test/test_codecs.py Python/codecs.c description: Issue #13916: Fix surrogatepass error handler on Windows diff -r b6c372147db4 -r 8ee2b73cda7a Lib/test/test_codecs.py --- a/Lib/test/test_codecs.py Thu May 15 20:50:30 2014 -0400 +++ b/Lib/test/test_codecs.py Fri May 16 14:46:20 2014 +0200 @@ -2841,12 +2841,6 @@ (b'abc', 'strict', 'abc'), (b'\xe9\x80', 'strict', '\xe9\u20ac'), (b'\xff', 'strict', '\xff'), - # invalid bytes - (b'[\x98]', 'strict', None), - (b'[\x98]', 'ignore', '[]'), - (b'[\x98]', 'replace', '[\ufffd]'), - (b'[\x98]', 'surrogateescape', '[\udc98]'), - (b'[\x98]', 'surrogatepass', None), )) def test_cp_utf7(self): diff -r b6c372147db4 -r 8ee2b73cda7a Python/codecs.c --- a/Python/codecs.c Thu May 15 20:50:30 2014 -0400 +++ b/Python/codecs.c Fri May 16 14:46:20 2014 +0200 @@ -960,6 +960,10 @@ } } } + else if (strcmp(encoding, "CP_UTF8") == 0) { + *bytelength = 3; + return ENC_UTF8; + } return ENC_UNKNOWN; }