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 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.
History
Date User Action Args
2010-02-24 10:59:34ezio.melottisetrecipients: + ezio.melotti, lemburg, doerwalter, amaury.forgeotdarc, vstinner, eric.smith, flox
2010-02-24 10:59:34ezio.melottisetmessageid: <1267009174.86.0.538566871818.issue7649@psf.upfronthosting.co.za>
2010-02-24 10:59:33ezio.melottilinkissue7649 messages
2010-02-24 10:59:32ezio.melotticreate