Skip to content

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

Merged
serhiy-storchaka merged 1 commit into
python:masterfrom
ZackerySpytz:bytesio_sizeof
Jun 1, 2019
Merged

[Skip Issue] Fix the error handling in bytesio_sizeof()#10459
serhiy-storchaka merged 1 commit into
python:masterfrom
ZackerySpytz:bytesio_sizeof

Conversation

@ZackerySpytz
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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