[issue13410] String formatting bug in interactive mode

2016-04-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue13410] String formatting bug in interactive mode

2016-04-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset a06654ca0134 by Serhiy Storchaka in branch '2.7': Issue #13410: Fixed a bug in PyUnicode_Format where it failed to properly https://hg.python.org/cpython/rev/a06654ca0134 -- nosy: +python-dev ___ Python t

[issue13410] String formatting bug in interactive mode

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The issue for str was fixed in issue15516. The issue for unicode is not fixed yet. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue13410] String formatting bug in interactive mode

2011-11-20 Thread Armin Rigo
Armin Rigo added the comment: Fwiw, a class with methods __long__ and __float__ but no method __int__ behaves strangely in many other places; the canonical example is that calling "int(Foo(42))" will not work. In light of this, does it make sense for "'%d' % Foo(42)" to work? Shouldn't the

[issue13410] String formatting bug in interactive mode

2011-11-16 Thread Eric V. Smith
Eric V. Smith added the comment: Interesting! Same here. Using eval() fails with or without -v: --- a/Lib/test/test_format.py +++ b/Lib/test/test_format.py @@ -289,6 +289,18 @@ else: raise TestFailed, '"%*d"%(maxsize, -127) should fail' +def test_issue13410(

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: $ ./python Lib/test/regrtest.py test_format shows the error, but $ ./python Lib/test/regrtest.py -v test_format does not fail! The "print" is needed, can something else have the same effect? -- ___ Python track

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: needs patch -> patch review versions: -Python 2.6 ___ Python tracker ___ ___

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Eric V. Smith
Eric V. Smith added the comment: With an unpatched 2.7, this fails for me: diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py --- a/Lib/test/test_format.py +++ b/Lib/test/test_format.py @@ -289,6 +289,17 @@ else: raise TestFailed, '"%*d"%(maxsize, -127)

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Unfortunately without the "print" the test does not fail. -- ___ Python tracker ___ ___ Pytho

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think you're going to want those print statements in a test. You could just evaluate '%d' % y. -- ___ Python tracker ___ __

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Sorry I found that u'%d' is equally affected, here is a new version. -- Added file: http://bugs.python.org/file23700/issue13410_3.patch ___ Python tracker __

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: New patch with a unit test. -- Added file: http://bugs.python.org/file23699/issue13410_2.patch ___ Python tracker ___ ___

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: A debug build displays "XXX undetected error". An error condition was not correctly cleared, see attached patch. -- keywords: +patch nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file23698/issue13410.patch ___

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Florent Xicluna
Florent Xicluna added the comment: With Darwin 10.8.0 x86_64, I confirm the behavior described in first message. $ python2.7 -V Python 2.7.2 $ python2.7 -i xx.py 22 22 >>> TypeError: int() argument must be a string or a number, not 'Foo' >>> '%d' % y '22' >>> '%d' % y TypeError: int() argumen

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox, mark.dickinson stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Eric V. Smith
Eric V. Smith added the comment: I think this must be a change between 2.5 and 2.6. In 2.5.1 non-debug (Linux) I consistently see: >>> print '%d' % y Traceback (most recent call last): File "", line 1, in TypeError: int argument required In 2.6.5 (Windows via activestate) I see the alternat

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Jayanth Raman
New submission from Jayanth Raman : With file xx.py: class Foo(object): def __init__(self, x): self.x = x def __long__(self): return long(self.x) def __float__(self): return float(self.x) y = Foo(22) print '%d' % y print '%d' % y Interactive mode: $ python