-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly #26764
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
Conversation
No longer use len() to get the length of the input data. For some buffer protocol objects, the length obtained by using len() is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks @animalize for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9. |
Sorry, @animalize and @serhiy-storchaka, I could not cleanly backport this to |
GH-26845 is a backport of this pull request to the 3.10 branch. |
…correctly (pythonGH-26764) No longer use len() to get the length of the input data. For some buffer protocol objects, the length obtained by using len() is wrong. (cherry picked from commit bc6c12c) Co-authored-by: Ma Lin <[email protected]>
|
…correctly (GH-26764) (GH-26845) No longer use len() to get the length of the input data. For some buffer protocol objects, the length obtained by using len() is wrong. (cherry picked from commit bc6c12c) Co-authored-by: Ma Lin <[email protected]>
The underlying C codes handle buffer protocol objects correctly, so only fix the wrong length in Python code is fine.
https://bugs.python.org/issue44439