Skip to content

[3.11] gh-113358: Fix rendering tracebacks with exceptions with a broken __getattr__ (GH-113359) - #114118

Merged
iritkatriel merged 7 commits into
python:3.11from
perrinjerome:backport-04fabe2-3.11
Jan 19, 2024
Merged

[3.11] gh-113358: Fix rendering tracebacks with exceptions with a broken __getattr__ (GH-113359)#114118
iritkatriel merged 7 commits into
python:3.11from
perrinjerome:backport-04fabe2-3.11

Conversation

@perrinjerome

@perrinjeromeperrinjerome commented Jan 16, 2024

Copy link
Copy Markdown
Contributor

(cherry picked from commit 04fabe2)

Adjusted for 3.11, because exception printing also happens in C code.

@perrinjeromeperrinjerome changed the title [3.11] gh-113358: Fix rendering tracebacks with exceptions with a bro…[3.11] gh-113358: Fix rendering tracebacks with exceptions with a broken getattr (GH-113359)Jan 16, 2024
@perrinjeromeperrinjerome changed the title [3.11] gh-113358: Fix rendering tracebacks with exceptions with a broken getattr (GH-113359)[3.11] gh-113358: Fix rendering tracebacks with exceptions with a broken __getattr__ (GH-113359)Jan 16, 2024
@perrinjerome
perrinjeromeforce-pushed the backport-04fabe2-3.11 branch 4 times, most recently from acf3006 to 453b2e0CompareJanuary 17, 2024 01:29
…en __getattr__ (pythonGH-113359)
cherry picked from commit 04fabe2
Adjusted for 3.11, because exception printing also happens in C
code.
Co-authored-by: Jérome Perrin <perrinjerome@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
@perrinjerome

Copy link
Copy Markdown
ContributorAuthor

This is not a trivial backport, cherry-picking the commit was not enough, there is also C code to format exceptions in 3.11 branch. The CI is OK, but I am not familiar with C programming and python C API so I might have made mistakes here.

@perrinjerome
perrinjerome marked this pull request as ready for review January 17, 2024 01:51
Comment threadPython/pythonrun.c Outdated
Comment threadMisc/NEWS.d/next/Library/2023-12-21-14-55-06.gh-issue-113358.nRkiSL.rst Outdated
Comment threadPython/pythonrun.c
Comment threadPython/pythonrun.c

@iritkatrieliritkatriel 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.

We can actually do this because we know it's not NULL.

Comment threadPython/pythonrun.c Outdated
Comment threadPython/pythonrun.c Outdated
@iritkatrieliritkatriel added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Jan 17, 2024
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 2c882e0 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Jan 17, 2024
Comment threadPython/pythonrun.c
@iritkatriel

Copy link
Copy Markdown
Member

There's a refleak test failure.

@iritkatriel

Copy link
Copy Markdown
Member

@perrinjerome

Copy link
Copy Markdown
ContributorAuthor

Thank you ! I could reproduce locally and pushed a fix. The problem was with missing decref on values returned by PyErr_Fetch ( https://docs.python.org/3.11/c-api/exceptions.html#c.PyErr_Fetch "you own a reference to each object retrieved." )

@iritkatrieliritkatriel added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Jan 19, 2024
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit a4613e2 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Jan 19, 2024
Comment threadPython/pythonrun.c
Comment threadPython/pythonrun.c Outdated
Comment threadPython/pythonrun.c Outdated
Comment threadPython/pythonrun.c
@iritkatrieliritkatriel added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Jan 19, 2024
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit d72e989 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@perrinjerome@bedevere-bot@iritkatriel