相关疑难解决方法(0)

Python 3 - 可以处理大于4GB的字节对象吗?

基于此注释和引用的文档,Python 3.4+中的Pickle 4.0+应该能够腌制大于4 GB的字节对象.

但是,在Mac OS X 10.10.4上使用python 3.4.3或python 3.5.0b2时,我尝试挑选一个大字节数组时出错:

>>> import pickle
>>> x = bytearray(8 * 1000 * 1000 * 1000)
>>> fp = open("x.dat", "wb")
>>> pickle.dump(x, fp, protocol = 4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument
Run Code Online (Sandbox Code Playgroud)

我的代码中是否有错误或我误解了文档?

python size pickle python-3.x

55
推荐指数
4
解决办法
2万
查看次数

标签 统计

pickle ×1

python ×1

python-3.x ×1

size ×1