-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Test if CookieJar pickle format breaks #7221
Conversation
Do I understand correctly that the save/load functionality will not be patched to be backward compatible with itself? That would seem antithetical to their purpose of persisting the value and being able to use it later. In fact, breaking changes would require the using application to migrate the data at which point it could be easier to write a custom save/load for itself. I feel like this is something the library should handle and not each application itself that uses it. |
Codecov Report
@@ Coverage Diff @@
## master #7221 +/- ##
==========================================
+ Coverage 97.25% 97.33% +0.08%
==========================================
Files 106 106
Lines 31300 31309 +9
Branches 3216 3891 +675
==========================================
+ Hits 30442 30476 +34
+ Misses 656 634 -22
+ Partials 202 199 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I'm not sure exactly how we'd handle this. Possibly adding a version number to the dict or something? |
Having said that, it's worth noting that this is a pickle format, so it seems highly unlikely that we'd guarantee that it would never break. So, I don't think we can really provide much of a guarantee here regardless. The fact that the implementation uses pickle suggests to me that it's a convenience function, rather than a file format that should be relied upon from version to version. i.e. I think we should only guarantee that a file saved and loaded from the same machine in the same version of Python and the same x.y version of aiohttp will work. |
It sounds like I've not understood truly what the save/load methods provide. The documentation does state it's using a "pickled representation", but I did not think much of it. Maybe a warning at the load would be nice that "Loading a saved value from a different version might not work" or something to make it explicit. I might look into making a PR later with a save/load serialization option that provides backward compatibility... it seems I have to do it anyways after all. |
Backport to 3.9: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 3058c72 on top of patchback/backports/3.9/3058c72dc417cf7fabcc5a1d71e5238f93469012/pr-7221 Backporting merged PR #7221 into master
🤖 @patchback |
Feel free to change that test alongside any other PRs to improve backwards compatibility. |
Fixes #7216 (well, stops it from happening accidentally again).