-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Problem serializing instance of a class that uses a module #616
Comments
can you give an example that I can confirm? especially if pickle works, as you say. It seems that your example works for me, so I'd like to see where you are seeing a failure.
|
If you put this in
this fails:
with error Can't pickle <class '_ctypes.PyCFuncPtrType'>: it's not found as _ctypes.PyCFuncPtrType. This succeeds:
And I can't remove the |
If you use this file (I'm testing on a MacOS, not Windows):
then do what you have above, I can reproduce the error with
because the class is pickled by reference, and the reference is not present. Were you to put this into a file, and then install the file as a module that is globally available upon import, then This is a known issue, so I'm going to close this as a duplicate... or you can confirm that |
Feel free to reopen given my notes above |
I have a problem serializing an instance of a class that uses a module, something like:
some_module
contains things that can't be serialized, and that's fine, I don't want to serialize it. But if I serialize withdill.settings["recurse"] = False
, I get the error name 'some_module' is not defined when deserializing. If I serialize withdill.settings["recurse"] = True
, I get an error about the things insome_module
that can't be serialized.I know as a workaround I can move the
import some_module
into thefoo
function, but I'm building a framework and I don't want to have to ask my users to do that. Also,Pickle
does not seem to have such an issue.The text was updated successfully, but these errors were encountered: