Author serhiy.storchaka
Recipients chris.jerdonek, ezio.melotti, gangesmaster, isoschiz, mark.dickinson, mrabarnett, serhiy.storchaka, vstinner
Date 2013-05-05.19:40:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1367782845.94.0.795725890781.issue16741@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a patch based on Matthew's patch. It is smaller (+35 lines vs +59) but fixes error messages for more cases:

int(b'123\0') -- bytes string with null without base.
int(b'123\xbd') -- non-utf-8 bytes string.
int('123\ud800') -- lone surrogate in unicode string.

Unfortunately it is not easy to backport it to 2.7. PyErr_Format() in 2.7 works only with null-terminated strings. I propose to fix this issue on 3.3+ and declare it as "won't fix" for 2.7.
History
Date User Action Args
2013-05-05 19:40:46serhiy.storchakasetrecipients: + serhiy.storchaka, mark.dickinson, vstinner, gangesmaster, ezio.melotti, mrabarnett, chris.jerdonek, isoschiz
2013-05-05 19:40:45serhiy.storchakasetmessageid: <1367782845.94.0.795725890781.issue16741@psf.upfronthosting.co.za>
2013-05-05 19:40:45serhiy.storchakalinkissue16741 messages
2013-05-05 19:40:45serhiy.storchakacreate