Message395971
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 call last):
File "E:\testlen.py", line 7, in <module>
pickle.dump(pd.DataFrame(range(1_000_000)), file, protocol=5)
File "D:\Python39\lib\lzma.py", line 234, in write
self._pos += len(data)
TypeError: object of type 'pickle.PickleBuffer' has no len()
The exception is raised in lzma.LZMAFile.write() method:
https://github.com/python/cpython/blob/v3.10.0b2/Lib/lzma.py#L238
PickleBuffer doesn't have .__len__ method, is it intended? |
|
Date |
User |
Action |
Args |
2021-06-17 05:05:24 | malin | set | recipients:
+ malin, pitrou |
2021-06-17 05:05:24 | malin | set | messageid: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> |
2021-06-17 05:05:24 | malin | link | issue44439 messages |
2021-06-17 05:05:23 | malin | create | |
|