Message100025
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. |
|
Date |
User |
Action |
Args |
2010-02-24 10:59:34 | ezio.melotti | set | recipients:
+ ezio.melotti, lemburg, doerwalter, amaury.forgeotdarc, vstinner, eric.smith, flox |
2010-02-24 10:59:34 | ezio.melotti | set | messageid: <1267009174.86.0.538566871818.issue7649@psf.upfronthosting.co.za> |
2010-02-24 10:59:33 | ezio.melotti | link | issue7649 messages |
2010-02-24 10:59:32 | ezio.melotti | create | |
|