Ezio Melotti <ezio.melo...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to