[issue16055] incorrect error text for int(base=1000, x='1')

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: I backported manually the fix to Python 2.7 for int and long types. Thank you Chris Jerdonek for the bug report, and Sanyam Khurana for the bugfix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue16055] incorrect error text for int(base=1000, x='1')

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset d13169fc5ac7572a272cbcff830c3d96ba27cc7c by Victor Stinner in branch '2.7': bpo-16055: Fixes incorrect error text for int('1', base=1000) (#6980)

[issue16055] incorrect error text for int(base=1000, x='1')

2018-05-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +6635 ___ Python tracker ___ ___

[issue16055] incorrect error text for int(base=1000, x='1')

2017-11-14 Thread STINNER Victor
STINNER Victor added the comment: Thank you Sanyam Khurana, I merged your PR and backported the fix automaticalled to Python 3.6. Can you please try to backport the fix to Python 2.7 and create a new PR? -- ___ Python

[issue16055] incorrect error text for int(base=1000, x='1')

2017-11-14 Thread STINNER Victor
STINNER Victor added the comment: New changeset 58cbae22930486814cc01cf9f981d9fe5e0c68f9 by Victor Stinner (Miss Islington (bot)) in branch '3.6': bpo-16055: Fixes incorrect error text for int('1', base=1000) (GH-4376) (#4389)

[issue16055] incorrect error text for int(base=1000, x='1')

2017-11-13 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4338 ___ Python tracker ___

[issue16055] incorrect error text for int(base=1000, x='1')

2017-11-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 28b624825eb92cb8c96fbf8da267d8d14a61a841 by Victor Stinner (Sanyam Khurana) in branch 'master': bpo-16055: Fixes incorrect error text for int('1', base=1000) (#4376)

[issue16055] incorrect error text for int(base=1000, x='1')

2017-11-12 Thread Sanyam Khurana
Change by Sanyam Khurana : -- pull_requests: +4325 stage: needs patch -> patch review ___ Python tracker ___

[issue16055] incorrect error text for int(base=1000, x='1')

2017-06-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Isn't the information provided in your previous message enough? -- ___ Python tracker ___

[issue16055] incorrect error text for int(base=1000, x='1')

2017-06-19 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "set keywords: + easy (C)" Thanks for making easy issues as easy and no fixing them :-) But in my experience, even if the issue seems easy to *you*, you should explain which file has to be patched, and what steps should be done to write the

[issue16055] incorrect error text for int(base=1000, x='1')

2017-06-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +easy (C) stage: test needed -> needs patch type: behavior -> enhancement versions: +Python 3.7 -Python 2.7, Python 3.3, Python 3.4 ___ Python tracker

[issue16055] incorrect error text for int(base=1000, x='1')

2017-03-07 Thread STINNER Victor
STINNER Victor added the comment: > Since the first parameter of int() is now positional-only, this issue looks > outdated. Right, but Python 3.7 still has this issue: "The *base* argument can also be 0." The error message should be: "ValueError: int() base must be >= 2 and <= 36 or 0" (add

[issue16055] incorrect error text for int(base=1000, x='1')

2017-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since the first parameter of int() is now positional-only, this issue looks outdated. -- status: open -> pending ___ Python tracker

[issue16055] incorrect error text for int(base=1000, x='1')

2013-12-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- priority: normal - low versions: +Python 3.4 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16055 ___

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-30 Thread Peter Inglesby
Peter Inglesby added the comment: Ok, I've now attached a patch with tests. -- Added file: http://bugs.python.org/file27353/issue16055-fix-with-tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16055

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-30 Thread Chris Jerdonek
Chris Jerdonek added the comment: A few comments on the patch: 1) You should also check the exception type (e.g. by using PyErr_ExceptionMatches()). 2) If the exception doesn't match, you should restore the original exception so that the pure Python test framework will in turn raise it and

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Peter Inglesby
Peter Inglesby added the comment: The attached patch updates the error message to: int(base=100, x='123') Traceback (most recent call last): File stdin, line 1, in module ValueError: int() base must be = 2 and = 36, or 0 -- keywords: +patch nosy: +inglesp Added file:

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: I should have said that I had started working on this issue. I think failing tests for both messages should accompany the patch (otherwise I would have already submitted a patch). The tricky one is the error message for PyLong_FromString(), which I believe

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Peter Inglesby
Peter Inglesby added the comment: Ah, sorry about that. Are you happy for me to write the test? Poking around the C API docs suggests that I should call PyErr_Fetch() to get the value of the a raised exception, but I can't see any precedent for this in existing test code. Can you point me

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: Are you happy for me to write the test? I had started working on that, but sure, be my guest. :) You seem to be on the right track. I didn't find precedent nearby either. We basically want a C version of unittest's assertRaisesRegex() (but it can be a

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: Attaching failing test for pure Python portion. -- Added file: http://bugs.python.org/file27333/issue-16055-1-failing-test.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16055

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: +with self.assertRaises(ValueError) as e: +int('100', 1) +self.assertEquals(str(e.exception), + int() arg base must be 0 or = 2 and = 36) Why not use assertRaisesRegex()?

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: It could be done that way. It just seems simpler to me to do a simple string check when regex's aren't necessary. Then you don't have to worry about escaping characters, etc. -- ___ Python tracker

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: Can't you test the PyLong_FromString code path by passing bytes to int()? int(b42) -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16055

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: Benjamin, unless I'm overlooking something, long_new() does its own check of the base argument before calling PyLong_FromString(): http://hg.python.org/cpython/file/default/Objects/longobject.c#l4251 So long_new() won't let you pass a bad base to

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: Ah, sorry, I misread what you wanted to be testing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16055 ___

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-26 Thread Chris Jerdonek
New submission from Chris Jerdonek: The following error text is incorrect in at least one way: int(base=1000, x='1') Traceback (most recent call last): File stdin, line 1, in module ValueError: int() arg 2 must be = 2 and = 36 The *base* argument can also be 0. Secondly, the text should

[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-26 Thread Chris Jerdonek
Chris Jerdonek added the comment: Locations: Objects/longobject.c 1994:int() arg 2 must be = 2 and = 36); 4273:int() arg 2 must be = 2 and = 36); -- ___ Python tracker rep...@bugs.python.org