STINNER Victor added the comment:

u'{0:c}'.format(256) calls 256.__format__('c') which returns a str (bytes) 
object, so we must reject value outside range(0, 256). The real fix for this 
issue is to upgrade to Python 3.

Attached patch works around the inital issue (u'{0:c}'.format(256)) by raising 
OverflowError on int.__format__('c') if the value is not in range(0, 256).

----------
Added file: http://bugs.python.org/file30747/int_format_c.patch

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

Reply via email to