Closed xzy3 closed 9 months ago
Can you post code that reproduces the error you are seeing?
I tried a few guesses at what iterable
is, and the code works as expected.
Python 3.10.13 (main, Aug 25 2023, 02:21:32) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dill
>>> iterable = [0,1,2,3,4,5]
>>> dill.loads(dill.dumps(iterable[0]))
0
>>> iterable = 'GATTACA'
>>> dill.loads(dill.dumps(iterable[0]))
'G'
I'm going to assume what you are experiencing is a case where pickle
is serializing something in iterable
by reference, while dill
is storing the same object's contents. A minimal example to reproduce the error you are seeing would enable me to test it out and potentially do something.
Can you also try running with dill.settings['byref'] = True
, and alternately, with dill.settings['recurse'] = True
?
It's actually from uqfoundation's multiprocess Pool.imap_unordered adding a work unit to the queue. But I think I found the problem.
I had added some code quite a while ago to hack around dill issue #332. It is apparently not needed anymore and is causing this new issue now. I commented that code out while working on a minimal example it resolved things.
dill version 0.3.7 centos stream python 3.10.4
I've run into a situation where the standard library pickle is successful in serializing an object, but dill has a bug.
here is the data serialized by dill