Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-76763: chr function raises ValueError exception instead OverflowError#104486

Closed
furkanonder wants to merge 2 commits into
python:mainpython/cpython:mainfrom
furkanonder:gh-76763furkanonder/cpython:gh-76763Copy head branch name to clipboard
Closed

gh-76763: chr function raises ValueError exception instead OverflowError#104486
furkanonder wants to merge 2 commits into
python:mainpython/cpython:mainfrom
furkanonder:gh-76763furkanonder/cpython:gh-76763Copy head branch name to clipboard

Conversation

@furkanonder

@furkanonder furkanonder commented May 14, 2023

Copy link
Copy Markdown
Contributor


i = _PyLong_AsInt(arg);
if (i == -1 && PyErr_Occurred()) {
if (PyErr_ExceptionMatches(PyExc_OverflowError)) {

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.

We shouldn't change the generated Argument Clinic files directly. I'm not sure, unfortunately, if there's an easy way to implement the desired behavior while still using Argument Clinic.

@furkanonder furkanonder added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Aug 6, 2023

@serhiy-storchaka serhiy-storchaka left a comment

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.

It is an implementation detail. On platform with INT_MAX >= 2**32 it raises ValueError.

@serhiy-storchaka

Copy link
Copy Markdown
Member

Also it may raise ValueError on other Python implementation.

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

Labels

awaiting review interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.