bpo-16055: Fixes incorrect error text for int('1', base=1000)#4376
Conversation
| if ((base != 0 && base < 2) || base > 36) { | ||
| PyErr_SetString(PyExc_ValueError, | ||
| "int() base must be >= 2 and <= 36"); | ||
| "int() base must be >= 2 and <= 36 or 0"); |
There was a problem hiding this comment.
While I proposed exactly this message, when I read again the issue, I prefer Peter's version with a comma. IMHO the comma helps to understand correctly the error :-)
"ValueError: int() base must be >= 2 and <= 36, or 0"
https://bugs.python.org/issue16055#msg171437
|
@Haypo fixed it :) |
|
Thanks @CuriousLearner for the PR, and @Haypo for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7. |
|
Thanks @CuriousLearner for the PR, and @Haypo for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
|
Sorry, @CuriousLearner and @Haypo, I could not cleanly backport this to |
|
I merged the PR #4389: backport to 3.6. |
|
"@serhiy-storchaka assigned vstinner 10 hours ago" Now I'm confused. This change has been merged a few months ago... |
|
@serhiy-storchaka: Did you assign this PR to me because of the backports labels? I don't know if this PR should be backported. |
|
Yes, because of the backports labels. |
|
The fix in the 3.6 branch is the commit: 58cbae2 |
|
2.7 backport: PR #6980. |
The fix is already applied on previous versions of Python. This fix shall now also work in 3.7
https://bugs.python.org/issue16055