Skip to content

[3.15] gh-157242: Do not close io.BytesIO on MemoryError (GH-157344) - #159275

Merged
vstinner merged 2 commits into
python:3.15from
miss-islington:backport-23eda00-3.15
Oct 13, 2026
Merged

vstinner merged 2 commits into
python:3.15from
miss-islington:backport-23eda00-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Replace _PyBytes_Resize() with _PyBytes_ResizeKeepOnError().

Fix truncate(): on error, restore string_size to its previous value.
(cherry picked from commit 23eda00)

Co-authored-by: Victor Stinner vstinner@python.org

)

Replace _PyBytes_Resize() with _PyBytes_ResizeKeepOnError().

Fix truncate(): on error, restore string_size to its previous value.
(cherry picked from commit 23eda00)

Co-authored-by: Victor Stinner <vstinner@python.org>
@vstinner

Copy link
Copy Markdown
Member

TSan fails. Ah yes, I need to backport another fix first: #159277.

@vstinner
vstinner merged commit 3ca92d9 into python:3.15 Oct 13, 2026
54 checks passed
@miss-islington
miss-islington deleted the backport-23eda00-3.15 branch October 13, 2026 00:05
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.

2 participants