Skip to content

gh-155419: honor the file object's current position in hashlib.file_digest - #155422

Open
picnixz wants to merge 5 commits into
python:mainfrom
picnixz:meta/crypto/py/hashlib/file-digest-honor-position-155419
Open

picnixz wants to merge 5 commits into
python:mainfrom
picnixz:meta/crypto/py/hashlib/file-digest-honor-position-155419

Conversation

@picnixz

@picnixz picnixz commented Aug 9, 2026 •

Copy link
Copy Markdown
Member

Comment thread Lib/hashlib.py Outdated
@picnixz picnixz removed the needs backport to 3.13 only security fixes label Oct 19, 2026
@picnixz picnixz self-assigned this Oct 19, 2026
@picnixz picnixz added the sprint label Oct 20, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Sprint Oct 20, 2026
…sIO` only

Objects exposing `getbuffer()` without being `io.BytesIO` instances
are now read through `readinto()`. The `io` module is imported lazily.
`BytesIOProxy` exposes the `io.BytesIO` interface without being an
instance of it, so `hashlib.file_digest` reads it with `readinto()`
from its current position.

@cmaloney cmaloney left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The hashlib change is good to me. The test_hashlib seems to add a lot of complexity for the extra things it's testing which seems out of proportion with the amount of hashlib code changed. If it's covering more I think the refactor is reasonable

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Sprint Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants