[issue7267] format method: c presentation type broken in 2.7

2015-11-09 Thread Walter Dörwald
Walter Dörwald added the comment: Don't worry, I've switched to using Python 3 in 2012, where this isn't a problem. ;) -- ___ Python tracker ___

[issue7267] format method: c presentation type broken in 2.7

2015-11-09 Thread STINNER Victor
STINNER Victor added the comment: Walter Dörwald added the comment: > Don't worry, I've switched to using Python 3 in 2012, where this isn't a > problem. ;) Wow, cool! We still have 1 or 2 customers stuck with Python 2, haha. -- ___ Python tracker

[issue7267] format method: c presentation type broken in 2.7

2015-11-09 Thread Berker Peksag
Changes by Berker Peksag : -- stage: commit review -> resolved ___ Python tracker ___

[issue7267] format method: c presentation type broken in 2.7

2015-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Then feel free to commit your patch please. It LGTM. -- stage: patch review -> commit review ___ Python tracker ___

[issue7267] format method: c presentation type broken in 2.7

2015-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2f2c52c9ff38 by Victor Stinner in branch '2.7': Issue #7267: format(int, 'c') now raises OverflowError when the argument is not https://hg.python.org/cpython/rev/2f2c52c9ff38 -- nosy: +python-dev ___

[issue7267] format method: c presentation type broken in 2.7

2015-11-09 Thread STINNER Victor
STINNER Victor added the comment: > Then feel free to commit your patch please. It LGTM. Thanks for the review ;-) @Walter: Sorry for the late fix (6 years later!). -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue7267] format method: c presentation type broken in 2.7

2015-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue7267] format method: c presentation type broken in 2.7

2015-11-09 Thread STINNER Victor
STINNER Victor added the comment: > Both ways, with OverflowError and Py3k DeprecationWarning, are good to me. > What would you say about this Benjamin? I prefer an OverflowError. I don't like having to enable a flag to fix a bug :-( According to the issue title, it's really a bug: "format

[issue7267] format method: c presentation type broken in 2.7

2015-06-10 Thread Jakub Wilk
Changes by Jakub Wilk jw...@jwilk.net: -- nosy: +jwilk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___ ___ Python-bugs-list mailing list

[issue7267] format method: c presentation type broken in 2.7

2015-05-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___ ___

[issue7267] format method: c presentation type broken in 2.7

2015-05-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a modification of Victor's patch, that just emits Py3k warning. Both ways, with OverflowError and Py3k DeprecationWarning, are good to me. What would you say about this Benjamin? -- Added file:

[issue7267] format method: c presentation type broken in 2.7

2015-05-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be just emit a warning in -3 mode? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___

[issue7267] format method: c presentation type broken in 2.7

2015-05-07 Thread Mark Lawrence
Mark Lawrence added the comment: What if any harm can be done by applying the patch with Victor's work around? -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___

[issue7267] format method: c presentation type broken

2014-04-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: If the purpose of backporting .format was/is to help people writing forward-looking code, or now, to write 23 code, then it should work like .format in 3.x, at lease when the format string is unicode. -- nosy: +terry.reedy stage: needs patch - patch

[issue7267] format method: c presentation type broken in 2.7

2014-04-30 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- title: format method: c presentation type broken - format method: c presentation type broken in 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267

[issue7267] format method: c presentation type broken

2013-07-01 Thread STINNER Victor
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

[issue7267] format method: c presentation type broken

2013-06-23 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- stage: test needed - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___ ___

[issue7267] format method: c presentation type broken

2013-03-23 Thread Francisco Martín Brugué
Francisco Martín Brugué added the comment: In 2.7.3 u'{0:c}'.format(127) u'\x7f' u'{0:c}'.format(128) Traceback (most recent call last): File pyshell#6, line 1, in module u'{0:c}'.format(128) UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in

[issue7267] format method: c presentation type broken

2013-03-23 Thread Francisco Martín Brugué
Francisco Martín Brugué added the comment: Adding a test that triggers the issue, let me know if is enough. -- keywords: +patch Added file: http://bugs.python.org/file29554/issue7267.patch ___ Python tracker rep...@bugs.python.org

[issue7267] format method: c presentation type broken

2011-11-19 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___ ___

[issue7267] format method: c presentation type broken

2010-03-09 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: u'{0:c}'.format(256) formatter in implemented in Objects/stringlib/formatter.h and this C template is instanciated in... Python/formatter_string.c (and not Python/formatter_unicode.c). Extract of formatter_unicode.c comment: /*

[issue7267] format method: c presentation type broken

2010-01-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: ('%c' % 255) == chr(255) == '\xff' '%c' % 256 raise an OverflowError: unsigned byte integer is greater than maximum and chr(256) raise a ValueError: chr() arg not in range(256). I prefer the second error ;-) str.format() should

[issue7267] format method: c presentation type broken

2010-01-21 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: See also issue #7649. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___

[issue7267] format method: c presentation type broken

2010-01-13 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___

[issue7267] format method: c presentation type broken

2009-11-10 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: so str.format() might raise an OverflowError for values = 128 (or = 256?) Maybe, but the issue you reported is in unicode.format() (not str.format()), and I think that should be fixed. I'm trying to think of how best to address it. As for the

[issue7267] format method: c presentation type broken

2009-11-10 Thread Walter Dörwald
Walter Dörwald wal...@livinglogic.de added the comment: Done: issue 7300. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___ ___