Bug report
Bug description:
hashlib.file_digest() takes a getbuffer() fast path that hashes the entire buffer regardless of tell(), so the same bytes at the same position give a different digest for io.BytesIO than for a real binary file.
We never had tests to exercise that behavior and we never got report about it. I want to sync the merges of all PRs at once so that the behavior is fixed simultaneously before the next release.
cc @gpshead @hugovk
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Bug report
Bug description:
hashlib.file_digest()takes agetbuffer()fast path that hashes the entire buffer regardless oftell(), so the same bytes at the same position give a different digest forio.BytesIOthan for a real binary file.We never had tests to exercise that behavior and we never got report about it. I want to sync the merges of all PRs at once so that the behavior is fixed simultaneously before the next release.
cc @gpshead @hugovk
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
hashlib.file_digest#155422