Skip to content

bpo-16055: Fixes incorrect error text for int('1', base=1000)#4376

Merged
vstinner merged 2 commits into
python:masterfrom
CuriousLearner:fix-issue-16055
Nov 13, 2017
Merged

bpo-16055: Fixes incorrect error text for int('1', base=1000)#4376
vstinner merged 2 commits into
python:masterfrom
CuriousLearner:fix-issue-16055

Conversation

@CuriousLearner

@CuriousLearner CuriousLearner commented Nov 12, 2017

Copy link
Copy Markdown
Member

The fix is already applied on previous versions of Python. This fix shall now also work in 3.7

https://bugs.python.org/issue16055

Comment thread Objects/longobject.c Outdated
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");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@CuriousLearner

Copy link
Copy Markdown
Member Author

@Haypo fixed it :)

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @CuriousLearner for the PR, and @Haypo for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @CuriousLearner for the PR, and @Haypo for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @CuriousLearner and @Haypo, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 28b624825eb92cb8c96fbf8da267d8d14a61a841 2.7

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2017
…GH-4376)

* bpo-16055: Fixes incorrect error text for int('1', base=1000)

* bpo-16055: Address review comments
(cherry picked from commit 28b6248)
vstinner pushed a commit that referenced this pull request Nov 14, 2017
@vstinner

Copy link
Copy Markdown
Member

I merged the PR #4389: backport to 3.6.

@vstinner

Copy link
Copy Markdown
Member

"@serhiy-storchaka assigned vstinner 10 hours ago"

Now I'm confused. This change has been merged a few months ago...

@vstinner

Copy link
Copy Markdown
Member

@serhiy-storchaka: Did you assign this PR to me because of the backports labels? I don't know if this PR should be backported.

@serhiy-storchaka

Copy link
Copy Markdown
Member

Yes, because of the backports labels.

@vstinner

Copy link
Copy Markdown
Member

The fix in the 3.6 branch is the commit: 58cbae2

@vstinner

Copy link
Copy Markdown
Member

2.7 backport: PR #6980.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants