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

[Skip Issue] Fix the error handling in bytesio_sizeof() #10459

Merged
merged 1 commit into from
Jun 1, 2019

Conversation

ZackerySpytz
Copy link
Contributor

bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf().

bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf().
@serhiy-storchaka
Copy link
Member

The check was omitted because I thought that _PySys_GetSizeOf() never fails here. Did I miss something? In what circumstances it can fail?

@ZackerySpytz
Copy link
Contributor Author

_PySys_GetSizeOf() -> object.__sizeof__() -> PyLong_FromSsize_t() -> _PyLong_New() -> MemoryError.

@csabella csabella requested a review from serhiy-storchaka May 22, 2019 23:53
@miss-islington
Copy link
Contributor

Thanks @ZackerySpytz for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 1, 2019
bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf().
(cherry picked from commit 36dcaab)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
@bedevere-bot
Copy link

GH-13733 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Jun 1, 2019
bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf().
(cherry picked from commit 36dcaab)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip issue skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants