Antoine Pitrou <pit...@free.fr> added the comment: "Fixing" multibytecodec.c produces a TypeError in the following test:
def test_errorcallback_longindex(self): dec = codecs.getdecoder('euc-kr') myreplace = lambda exc: ('', sys.maxsize+1) codecs.register_error('test.cjktest', myreplace) self.assertRaises(IndexError, dec, 'apple\x92ham\x93spam', 'test.cjktest') TypeError: decode() argument 1 must be bytes or buffer, not str Since the test is meant to test recovery from a misbehaving callback, I guess the type of the input string is not really important and can be changed to a bytes string instead. What do you think? (in any case, here is a patch) Added file: http://bugs.python.org/file12831/mbdecode-unicode.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4874> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com