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

Appearance settings

gh-122179: Fix hashlib.file_digest and non-blocking I/O #122183

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

Merged
merged 6 commits into from
Apr 21, 2025

Conversation

srittau
Copy link
Contributor

@srittau srittau commented Jul 23, 2024

@srittau
Copy link
Contributor Author

srittau commented Jul 23, 2024

While this is technically an API change, I think this should be backported to releases that are still in bugfix mode, as the current behavior can cause hard to find bugs instead of failing fast.

Lib/hashlib.py Show resolved Hide resolved
Lib/test/test_hashlib.py Show resolved Hide resolved
Copy link
Contributor

@cmaloney cmaloney left a comment

Choose a reason for hiding this comment

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

I think this is a positive change as is and test covers if this regresses in the future.

I think part of the cause of this is RawIO (ex. FileIO) vs. BufferedIO (and TextIO). Code exists in the wild using RawIO with this, which returns None, so updating to be more batteries included makes sense.

@picnixz picnixz self-requested a review April 14, 2025 09:51
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

I reviewed this last year, before I knew more about the workflow so here are some improved comments.

Doc/library/hashlib.rst Show resolved Hide resolved
Lib/test/test_hashlib.py Show resolved Hide resolved
Lib/hashlib.py Show resolved Hide resolved
@gpshead gpshead added the needs backport to 3.13 bugs and security fixes label Apr 21, 2025
@gpshead gpshead merged commit 2b47f46 into python:main Apr 21, 2025
45 checks passed
@miss-islington-app
Copy link

Thanks @srittau for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @srittau and @gpshead, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 2b47f46d7dc30d27b2486991fea4acd83553294b 3.13

gpshead added a commit that referenced this pull request Apr 21, 2025
…2787)

gh-122179: Fix hashlib.file_digest and non-blocking I/O (GH-122183)

* Fix hashlib.file_digest and non-blocking I/O
* Add documentation around this behavior
* Add versionchanged

(cherry picked from commit 2b47f46)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
@srittau srittau deleted the file-digest-readinto branch April 21, 2025 22:35
@hugovk hugovk removed the needs backport to 3.13 bugs and security fixes label May 20, 2025
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.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.