[issue7649] "u'%c' % char" broken for chars in range '\x80'-'\xFF'

Ezio Melotti report at bugs.python.org
Thu Jan 7 12:49:17 CET 2010


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

If we allow it to work on 2.7 the code will break:
1) when ported to Py3, where mixing bytes strings and unicode is not allowed;
2) when used on Py<2.7, where the behavior is broken;
3) when converted to str.format, where only ints are accepted.

If we raise an error, the user will have to either use unicode strings or ints and he will avoid further problems. Moreover, the fact that no one noticed this problems means that is not a common operation, so no one probably expects it to work anyway and raising an error could even help to find the problem if someone used %c in older versions.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7649>
_______________________________________


More information about the Python-bugs-list mailing list