Skip to content

gh-89419: gdb: fix printing AttributeError in py-locals when no frame is available - #100611

Merged
kumaraditya303 merged 2 commits into
python:mainfrom
eli-schwartz:gdb
Jan 3, 2023
Merged

gh-89419: gdb: fix printing AttributeError in py-locals when no frame is available#100611
kumaraditya303 merged 2 commits into
python:mainfrom
eli-schwartz:gdb

Conversation

@eli-schwartz

@eli-schwartzeli-schwartz commented Dec 30, 2022

Copy link
Copy Markdown
Contributor
Unable to read information on python frame
Python Exception <class 'AttributeError'>: 'NoneType' object has no attribute 'co_name'

Regression in commit b4903af. While refactoring the code into a while loop, the previous early return when no frame exists went missing. We have just printed a message that we cannot get information about this, so the frame will be None, and we cannot attempt to use it.

Discovered on python 3.11, in python 3.12a2 this should error out with .is_shim() instead of co_name.

…e is available
```
Unable to read information on python frame
Python Exception <class 'AttributeError'>: 'NoneType' object has no attribute 'co_name'
```
Regression in commit b4903af. While
refactoring the code into a while loop, the previous early return when
no frame exists went missing. We have just printed a message that we
cannot get information about this, so the frame will be None, and we
cannot attempt to use it.
Discovered on python 3.11, in python 3.12a2 this should error out with
`.is_shim()` instead of `co_name`.
@eli-schwartz

Copy link
Copy Markdown
ContributorAuthor

This will need manual backporting to 3.11 as cherry-picking doesn't apply cleanly. Prepared at 199e6ec.

@AlexWaygoodAlexWaygood changed the title bpo-45256: gdb: fix printing AttributeError in py-locals when no frame is availablegh-89419: gdb: fix printing AttributeError in py-locals when no frame is availableDec 30, 2022
Comment threadMisc/NEWS.d/next/Tools-Demos/2022-12-29-19-22-11.bpo-45256.a0ee_H.rst Outdated
@kumaraditya303
kumaraditya303 merged commit 8586949 into python:mainJan 3, 2023
@kumaraditya303

Copy link
Copy Markdown
Contributor

@eli-schwartz Go ahead with the backport, thanks.

eli-schwartz added a commit to eli-schwartz/cpython that referenced this pull request Jan 4, 2023
… no frame is available (pythonGH-100611)
```
Unable to read information on python frame
Python Exception <class 'AttributeError'>: 'NoneType' object has no attribute 'co_name'
```
Regression in commit b4903af. While
refactoring the code into a while loop, the previous early return when
no frame exists went missing. We have just printed a message that we
cannot get information about this, so the frame will be None, and we
cannot attempt to use it.
Discovered on python 3.11, in python 3.12a2 this should error out with
`.is_shim()` instead of `co_name`.
(cherry picked from commit 8586949)
@bedevere-bot

Copy link
Copy Markdown

GH-100738 is a backport of this pull request to the 3.11 branch.

@eli-schwartz
eli-schwartz deleted the gdb branch January 4, 2023 05:50
kumaraditya303 pushed a commit that referenced this pull request Jan 4, 2023
…n no frame is available (GH-100611) (#100738)
gh-89419: gdb: fix bug causing AttributeError in py-locals when no frame is available (GH-100611)
```
Unable to read information on python frame
Python Exception <class 'AttributeError'>: 'NoneType' object has no attribute 'co_name'
```
Regression in commit b4903af. While
refactoring the code into a while loop, the previous early return when
no frame exists went missing. We have just printed a message that we
cannot get information about this, so the frame will be None, and we
cannot attempt to use it.
Discovered on python 3.11, in python 3.12a2 this should error out with
`.is_shim()` instead of `co_name`.
(cherry picked from commit 8586949)
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.

4 participants

@eli-schwartz@kumaraditya303@bedevere-bot@pablogsal