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 vstinner
Recipients vstinner
Date 2011-10-18.11:50:10
SpamBayes Score 6.1107335e-07
Marked as misclassified No
Message-id <1318938611.14.0.651217726677.issue13209@psf.upfronthosting.co.za>
In-reply-to
Content
It's difficult to use unicode_encode_call_errorhandler() because the caller has to:

 - resize the output buffer (and check for integer overflow on the new size)
 - handle bytes and str for the replacement string: PyUnicode_EncodeDecimal() doesn't support bytes for example
 - encode replacement str: some encoders uses ASCII, unicode_encode_ucs1() uses Latin1, PyUnicode_EncodeCharmap() uses a recursive call (without check for infinite loop!), ... ; and raise a UnicodeEncodeError if the encoding fails

It would be nice to factorize this code.

I plan this implement this refactoring, it's just a reminder for me :-)
History
Date User Action Args
2011-10-18 11:50:11vstinnersetrecipients: + vstinner
2011-10-18 11:50:11vstinnersetmessageid: <1318938611.14.0.651217726677.issue13209@psf.upfronthosting.co.za>
2011-10-18 11:50:10vstinnerlinkissue13209 messages
2011-10-18 11:50:10vstinnercreate