Skip to content
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

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

Merged
merged 2 commits into from
Jan 3, 2023

Conversation

eli-schwartz
Copy link
Contributor

@eli-schwartz eli-schwartz commented Dec 30, 2022

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
Contributor Author

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

@AlexWaygood AlexWaygood changed the title bpo-45256: gdb: fix printing AttributeError in py-locals when no frame is available gh-89419: gdb: fix printing AttributeError in py-locals when no frame is available Dec 30, 2022
@kumaraditya303 kumaraditya303 merged commit 8586949 into python:main Jan 3, 2023
@kumaraditya303
Copy link
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

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 free to 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.

None yet

4 participants