Enhance pickle compatibility: support legacy tuple state and maintain…#4982
Enhance pickle compatibility: support legacy tuple state and maintain…#4982polybassa merged 3 commits intosecdev:masterfrom
Conversation
… packet metadata during serialization The new regression tests protect against breaking older pickle payloads by ensuring legacy tuple-state unpickling still works. They also lock in current behavior for the new state format by checking full metadata and comments fidelity after pickle roundtrip. This gives coverage for both backward compatibility and current serialization behavior in one place: test/regression.uts.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4982 +/- ##
==========================================
- Coverage 80.27% 80.26% -0.01%
==========================================
Files 382 382
Lines 94349 94362 +13
==========================================
+ Hits 75736 75739 +3
- Misses 18613 18623 +10
🚀 New features to boost your workflow:
|
|
@guedou I've encountered a problem that "old" pickled values can not be unpickled anymore. I've added support for the legacy pickle structure. |
guedou
left a comment
There was a problem hiding this comment.
Looks good to me, but I don't understand why we need to have backwards compatibility for this feature.
|
I stumbled over it when un-pickling older objects. I would help me for some use cases, if we stay backward compatible. |
|
I really don’t feel that we should keep both serialization methods.Sent from my iPhoneOn 27 Apr 2026, at 19:29, Nils Weiss ***@***.***> wrote:polybassa left a comment (secdev/scapy#4982)
I stumbled over it when un-pickling older objects. I would help me for some use cases, if we stay backward compatible.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
This PR just added the old deserialisation. For serialisation we only use the new format. At least for one release, I recommend to still support the old deserialisation. |
… packet metadata during serialization
The new regression tests protect against breaking older pickle payloads by ensuring legacy tuple-state unpickling still works. They also lock in current behavior for the new state format by checking full metadata and comments fidelity after pickle roundtrip. This gives coverage for both backward compatibility and current serialization behavior in one place: test/regression.uts.
Checklist :
tox)I understand that failing to mention the use of AI may result in a ban. (We do not forbid it, but you must play fair. Be warned !)
fixes #xxx