-
Notifications
You must be signed in to change notification settings - Fork 59
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
Multiple pickle roundtrip serializations cause KeyError #450
Labels
bug
Something isn't working
Comments
Thanks @kujenga. Since if "_client" in state:
del state["_client"] Would be happy to take a PR that does that and adds a test. Thanks! |
kujenga
added a commit
to kujenga/cloudpathlib
that referenced
this issue
Jul 21, 2024
This avoids an exception thrown because the client is not serialized into the pickeld object, and thus when __getstate__ is called the second time, there is no _client field to delete. Closes drivendataorg#450
10 tasks
Sounds good! PR submitted here: #454 |
kujenga
added a commit
to kujenga/cloudpathlib
that referenced
this issue
Jul 21, 2024
This avoids an exception thrown because the _client is not serialized into the pickled object, and thus when __getstate__ is called the second time, there is no _client field to delete. Closes drivendataorg#450
pjbull
pushed a commit
that referenced
this issue
Aug 15, 2024
This avoids an exception thrown because the _client is not serialized into the pickled object, and thus when __getstate__ is called the second time, there is no _client field to delete. Closes #450
Yes, this is working great for us! Thanks so much |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code causes a crash, which can arise when passing cloudpathlib objects to/from subprocesses.
The exception raised is:
The issue seems to be that these methods are not symmetrical, and the _client field is not restored when the object is unpickled in a way that might mirror this example in the docs https://docs.python.org/3/library/pickle.html#pickle-state at this point in the code:
cloudpathlib/cloudpathlib/cloudpath.py
Lines 262 to 272 in 08b018b
The text was updated successfully, but these errors were encountered: