Message100025
| Author |
ezio.melotti |
| Recipients |
amaury.forgeotdarc, doerwalter, eric.smith, ezio.melotti, flox, lemburg, vstinner |
| Date |
2010年02月24日.10:59:32 |
| SpamBayes Score |
5.75362e-12 |
| Marked as misclassified |
No |
| Message-id |
<1267009174.86.0.538566871818.issue7649@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I was trying to decode mainly to get a UnicodeDecodeError automatically.
If I check if the char is not in the ASCII range (i.e. >0x7F) I think I'd have to set the error message for the UnicodeDecodeError manually and possibly duplicate it (unless we use a different error message that says that %c accepts only ASCII chars).
Also I agree that if u'%s' % chr(0x80) works when the default encoding is not ASCII, then %c should work as well. Trying to decode it with the default encoding and possibly let the UnicodeDecodeError propagate seems a good solution to me (and performance shouldn't be a problem here, since apparently no one uses u'%c' with non-ASCII byte strings).
I will try to make another patch. |
|