Skip to content

gh-157242: Leave bytearray unchanged if resize() fails - #157340

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:bytearray_error
Sep 12, 2026
Merged

gh-157242: Leave bytearray unchanged if resize() fails#157340
vstinner merged 1 commit into
python:mainfrom
vstinner:bytearray_error

Conversation

@vstinner

@vstinner vstinner commented Sep 11, 2026

Copy link
Copy Markdown
Member

If bytearray.resize() or bytearray.take_bytes() fails, leave the bytearray unchanged.

Add PyBytesWriter_Resize() error test on bytearray.

If bytearray.resize() or bytearray.take_bytes() fails, leave the
bytearray unchanged.

Add PyBytesWriter_Resize() error test on bytearray.
@vstinner
vstinner merged commit 67e6be7 into python:main Sep 12, 2026
56 checks passed
@vstinner
vstinner deleted the bytearray_error branch September 12, 2026 02:24
@vstinner

Copy link
Copy Markdown
Member Author

See #157243 for the history and reviews of a previous version of this PR. I splitted the PR into two PRs to have smaller commits.

clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
…157340)

If bytearray.resize() or bytearray.take_bytes() fails, leave the
bytearray unchanged.

Add PyBytesWriter_Resize() error test on bytearray.
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.

1 participant