You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Python version 2.7.11, cloudpickle version 0.2.2 and six version 1.10.0, this throws a RuntimeError with the message "maximum recursion depth exceeded while calling a Python object":
cloudpickle version: 0.2.2
six version: 1.10.0
Traceback (most recent call last):
File "test.py", line 10, in <module>
cloudpickle.loads(cloudpickle.dumps(six.moves))
File "/opt/python/python-2.7/lib64/python2.7/pickle.py", line 1388, in loads
return Unpickler(file).load()
File "/opt/python/python-2.7/lib64/python2.7/pickle.py", line 864, in load
dispatch[key](self)
File "/opt/python/python-2.7/lib64/python2.7/pickle.py", line 1221, in load_build
setstate = getattr(inst, "__setstate__", None)
File "/usr/local/python/python-2.7/std/lib/python2.7/site-packages/six.py", line 118, in __getattr__
_module = self._resolve()
File "/usr/local/python/python-2.7/std/lib/python2.7/site-packages/six.py", line 115, in _resolve
return _import_module(self.mod)
...
The reason for pickling six.moves is that a recent commit to cloudpickle changed it to pickle any modules that are used by functions, so pickling a function will also pickle any modules that it uses. For example, the bug is triggered by:
six.moves cannot be pickled with cloudpickle. Reproducer:
With Python version 2.7.11, cloudpickle version 0.2.2 and six version 1.10.0, this throws a RuntimeError with the message "maximum recursion depth exceeded while calling a Python object":
The reason for pickling six.moves is that a recent commit to cloudpickle changed it to pickle any modules that are used by functions, so pickling a function will also pickle any modules that it uses. For example, the bug is triggered by:
I think the issue can be fixed by defining
_LazyModule.__reduce__
:The text was updated successfully, but these errors were encountered: