-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
dump_session not working if getpass module is imported #319
Comments
The exception is raised when trying to pickle a zmq socket. Probably because getpass references sys.stdout, which references a zmq socket when running in a jupyter notebook. See https://gist.github.com/joar/e03a63a1329cb70c91c4c811b7365cb2 for a minimal example. |
uqfoundation/pathos#132 seems to be |
To be able to dump your session, you probably need to remove all references to |
Yeah, my workaround was exactly adding |
@danilociaffi It may not be good form to post this here, but since the As a side note, I still haven't wrapped my head around what I would assume would be the correct way to serialize a socket. |
@joar: I'm not sure what you mean by Python 3 compatibility issues. FYI So, if you have important objects that are not supported, then please post an issue, and it will be dealt with (I realize you already posted the Anyway, @joar I agree with most of your comments, and that this is a similar/duplicate to uqfoundation/pathos#132. Also @danilociaffi: note that there is an old enhancement request that would be helpful to you, and it's basically your workaround. See issue #66. @danilociaffi: If you feel your question has been addressed, then please close the issue. |
Thank you for your clarifying response @mmckerns The plural compatibility issues were mentioned in a comment on my dill-related apache-beam JIRA ticket - I've only found a singular issue (#321), albeit a I understand it's impossible to stay on top of everything anyone is trying to pickle under any possible environment. - I did experiment with cloudpickle and found out that it's as you describe regarding coverage: import cloudpickle
import sys
cloudpickle.dumps(sys.modules["__main__"]) gives Traceback (most recent call last):
# [...]
PicklingError: args from save_reduce() must be a tuple |
@danilociaffi: I don't believe a |
I understand, my workaround seems to solve my problems anyway. |
I have a Jupyter notebook whose state I want to save using dill.dump_session, however the function throws an error if the notebook uses the getpass module.
I understand the point of not dumping the password, but how can I save the rest of the session?
Here's a toy example of my code:
and here is the error I get:
The text was updated successfully, but these errors were encountered: