-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Hyperlink Class Cannot Be Pickled #3628
Comments
Thanks a lot @mlavin. I think this can be linked to another issue where cache was failing with a similar message though we were not able to identify where it did come from. |
Hi @xordoquy, I would like to start contributing. Can I try this issue? I have solved @mlavin 's specific case by implementing the getnewargs() method https://docs.python.org/3.1/library/pickle.html#pickle.object.__getnewargs__ in lsanpablo@44a3d41 , but I've yet to write a test case. |
Hi @Cheglader, thanks for working at it. Looking forward to your pull request :) |
Same issue using |
I'd be great if anyone having this issue could give @Cheglader's PR #3701 a try. |
This is my example code that fails.
Error:
Adding the following fixes the issue for me:
|
Fix #3628 by implementing __getnewargs__()
Related to #3350, the
rest_framework.relations.Hyperlink
instances cannot be pickled as demonstrated with this sample:For serializers which use the hyperlink relations, this breaks the caching of the response objects since most of the cache backends rely on pickle by default.
The text was updated successfully, but these errors were encountered: