Python 3 - Can pickle handle byte objects larger than 4GB? -


based on comment , referenced documentation, pickle 4.0+ python 3.4+ should able pickle byte objects larger 4 gb.

however, using python 3.4.3 or python 3.5.0b2 on mac os x 10.10.4, error when try pickle large byte array:

>>> 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 

is there bug in code or misunderstanding documentation?

to sum answered in comments:

yes, python can pickle byte objects bigger 4gb. observed error caused bug in implementation (see issue24658).


Comments