[issue44439] PickleBuffer doesn't have __len__ method

2021-06-17 Thread Ma Lin
Change by Ma Lin : -- keywords: +patch pull_requests: +25350 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26764 ___ Python tracker ___ _

[issue44439] PickleBuffer doesn't have __len__ method

2021-06-16 Thread Ma Lin
Ma Lin added the comment: Ok, I'm working on a PR. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue44439] PickleBuffer doesn't have __len__ method

2021-06-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, LZMAFile.write() should not use len() directly on input data because it does not always work correctly with memoryview and other objects supporting the buffer protocol. It should use memoryview(data).nbytes or data = memoryview(data).cast('B') if other

[issue44439] PickleBuffer doesn't have __len__ method

2021-06-16 Thread Ma Lin
New submission from Ma Lin : If run this code, it will raise an exception: import pickle import lzma import pandas as pd with lzma.open("test.xz", "wb") as file: pickle.dump(pd.DataFrame(range(1_000_000)), file, protocol=5) The exception: Traceback (most recent ca