Skip to content

gh-126035: add missing whitespace to *Py_EnterRecursiveCall messages #126036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Oct 27, 2024

I don't know how to test it easily though so if anyone knows, feel free to help me! (or we can just observe that all other occurrences are prefixing the message with a whitespace and be done).

@ZeroIntensity
Copy link
Member

The way to test it would be to just trigger the recursion error and then catch it with an assertRaisesRegex. An alternative solution here would be to implicitly add leading whitespace in _Py_EnterCursiveCall if it's not there already (changing it for the public one would be a breaking change).

@picnixz
Copy link
Member Author

picnixz commented Oct 27, 2024

The way to test it would be to just trigger the recursion error

Yes, that's what I wanted to find :') (I was a bit lazy here TBH).

An alternative solution here would be to implicitly add leading whitespace in _Py_EnterCursiveCall if it's not there already

I don't really want to. At least, it doesn't hurt to always add it. We could implicitly add the whitespace by using strncmp (which was my original idea) but I think it's just easier to include it in the message.

@erlend-aasland erlend-aasland changed the title gh-126035: fix some typos in *Py_EnterRecursiveCall* usages gh-126035: add missing whitespace in *Py_EnterRecursiveCall messages Oct 27, 2024
@erlend-aasland erlend-aasland changed the title gh-126035: add missing whitespace in *Py_EnterRecursiveCall messages gh-126035: add missing whitespace to *Py_EnterRecursiveCall messages Oct 27, 2024
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

I wasn't actually able to trigger the RecursionError in either of these cases--the "while calling a Python object" beat it, so this might be dead code anyway. LGTM!

@erlend-aasland erlend-aasland merged commit 19e93e2 into python:main Oct 27, 2024
42 checks passed
@miss-islington-app

This comment was marked as outdated.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 27, 2024
…essages (pythonGH-126036)

(cherry picked from commit 19e93e2)

Co-authored-by: Bénédikt Tran <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 27, 2024
…essages (pythonGH-126036)

(cherry picked from commit 19e93e2)

Co-authored-by: Bénédikt Tran <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 27, 2024

GH-126058 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 27, 2024
@bedevere-app
Copy link

bedevere-app bot commented Oct 27, 2024

GH-126059 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Oct 27, 2024
@picnixz picnixz deleted the fix/typo-in-recursion-errors branch October 27, 2024 22:02
erlend-aasland pushed a commit that referenced this pull request Oct 27, 2024
…messages (GH-126036) (#126059)

(cherry picked from commit 19e93e2)

Co-authored-by: Bénédikt Tran <[email protected]>
erlend-aasland pushed a commit that referenced this pull request Oct 27, 2024
…messages (GH-126036) (#126058)

(cherry picked from commit 19e93e2)

Co-authored-by: Bénédikt Tran <[email protected]>
picnixz added a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
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.

3 participants