]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44439: BZ2File.write()/LZMAFile.write() handle length correctly (GH-26846)
authorMa Lin <animalize@users.noreply.github.com>
Tue, 22 Jun 2021 13:57:41 +0000 (21:57 +0800)
committerGitHub <noreply@github.com>
Tue, 22 Jun 2021 13:57:41 +0000 (16:57 +0300)
commit8bc26d8c9d092840054f57f9b4620de0d40d8423
tree3dc513f095270c7efc8d44fcb02e4dc0349f23df
parent0ff487b8abe70f091285acf367b795861eed8049
bpo-44439: BZ2File.write()/LZMAFile.write() handle length correctly (GH-26846)

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.

Co-authored-by: Marco Ribeiro <marcoffee@users.noreply.github.com>
Lib/bz2.py
Lib/lzma.py
Lib/test/test_bz2.py
Lib/test/test_lzma.py
Misc/NEWS.d/next/Library/2021-06-17-15-01-51.bpo-44439.1S7QhT.rst [new file with mode: 0644]