-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialize/deserialize inconsistent for certain types in 0.4.0 #117
Comments
Still an issue in Also stealing from issue ( #101 ). Appears roundtrips on In [1]: import enum
...: class MyEnum(enum.Enum):
...: SPAM = 'SPAM'
...:
...: import cloudpickle
...: cloudpickle.loads(cloudpickle.dumps(MyEnum.SPAM))
...:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-3cc75bf49a58> in <module>()
4
5 import cloudpickle
----> 6 cloudpickle.loads(cloudpickle.dumps(MyEnum.SPAM))
/zopt/conda2/envs/nanshenv3/lib/python3.6/enum.py in __new__(metacls, cls, bases, classdict)
133 # save enum items into separate mapping so they don't get baked into
134 # the new class
--> 135 enum_members = {k: classdict[k] for k in classdict._member_names}
136 for name in classdict._member_names:
137 del classdict[name]
AttributeError: 'dict' object has no attribute '_member_names' Edit: Fixed in 1.2.1. |
the
|
That sounds reasonable. Stepping back a bit. It's probably fair to ask, why does one want to pickle a lock? |
Agreed, I have no idea if that even makes sense. But note that in this setting, |
Good point. Was thrown off by the slightly circuitous nature of the code. |
So what should we do? Add an entry to the cloudpickle dispatch table to make sure we raise |
This might prevent pickling interactively defined functions that have reference a lock instance as global variable in |
In 0.4.0 I can serialize a type, but not deserialize it:
The text was updated successfully, but these errors were encountered: