Message188458
| 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'1230円') -- 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. |
|