Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-143689: Fix BufferedReader.read1 leaving object in reentrant state on error#143690

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 9 commits intopython:mainfromhyongtao-code:dev-io-buffer
Jan 19, 2026

Conversation

@hyongtao-code
Copy link
Contributor

@hyongtao-codehyongtao-code commentedJan 11, 2026
edited by bedevere-appbot
Loading

BufferedReader.read1() could leave the buffered object in a
reentrant (locked) state when an exception was raised while
allocating the output buffer.

This change ensures the internal buffered lock is always released
on error, keeping the object in a consistent state after failures.

BufferedReader.read1() could leave the buffered object in areentrant (locked) state when an exception was raised whileallocating the output buffer.This change ensures the internal buffered lock is always releasedon error, keeping the object in a consistent state after failures.Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Copy link
Contributor

@cmaloneycmaloney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for the patch! The fix looks correct. The NEWs entry and test don't quite match the preferred patterns in CPython, left some comments.

hyongtao-codeand others added2 commitsJanuary 12, 2026 06:30
…zHJ2W.rstCo-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
@hyongtao-code
Copy link
ContributorAuthor

The NEWs entry and test don't quite match the preferred patterns in CPython,

Thanks for the review and feedback — I’ve made the requested changes.

@cmaloney
Copy link
Contributor

Please don't force-push to CPython PR branches:https://devguide.python.org/getting-started/pull-request-lifecycle/#don-t-force-push

hyongtao-code reacted with eyes emoji

@hyongtao-code
Copy link
ContributorAuthor

don't force-push

Sorry — I only realized afterward that using git revert to undo the previous commit would have been the better choice.
Thanks for pointing that out; I’ll keep it in mind.

cmaloney reacted with thumbs up emoji

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. It seems like I introduced the regression in 3.15 with the commit4554486.

@cmaloney
Copy link
Contributor

and I missed it in review but should have caught it :)

@vstinnervstinner merged commit375e372 intopython:mainJan 19, 2026
50 checks passed
@vstinner
Copy link
Member

Merged, thanks for the fix and the test.

hyongtao-code and cmaloney reacted with laugh emoji

@hyongtao-codehyongtao-code deleted the dev-io-buffer branchJanuary 19, 2026 15:50
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cmaloneycmaloneycmaloney approved these changes

@sobolevnsobolevnsobolevn left review comments

@vstinnervstinnervstinner approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@hyongtao-code@cmaloney@vstinner@sobolevn

[8]ページ先頭

©2009-2026 Movatter.jp