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 pitrou
Recipients amaury.forgeotdarc, lemburg, pitrou, vstinner
Date 2009-01-22.11:04:48
SpamBayes Score 4.9738115e-05
Marked as misclassified No
Message-id <1232622311.46.0.32785075646.issue4874@psf.upfronthosting.co.za>
In-reply-to
Content
"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)
History
Date User Action Args
2009-01-22 11:05:12pitrousetrecipients: + pitrou, lemburg, amaury.forgeotdarc, vstinner
2009-01-22 11:05:11pitrousetmessageid: <1232622311.46.0.32785075646.issue4874@psf.upfronthosting.co.za>
2009-01-22 11:04:50pitroulinkissue4874 messages
2009-01-22 11:04:49pitroucreate