Repository navigation
refactor!: hold mapping values in Info or Data, not dict subclasses (#2726) - #2734
Merged
Merged
Conversation
…2726) - FrameRecord is an Info rather than a slotted dict subclass, so it is immutable and no dict. Its mapping is the engine's dissection; packet, frame_info and time_epoch sit under hidden dunder keys, read through __getattribute__, so a mapping key of the same name never shadows them. It pickles through _frame_record, as the 1.5 releases do, and to_dict() exports the mapping alone. - TLSKeyLog.entries is a TLSKeyLogEntries data model keyed by label, not a plain dict, and a mapping given for it is stored as one. to_dict() exports it as an OrderedMultiDict, as #1484 requires of every level; TLSKeyLog pickles hold the entries as a dict and restore the model. - The traced Packet's frame annotation names FrameRecord, and its versionchanged notes what from_dict(to_dict()) gives back; the pickle docs drop FrameRecord as their slotted-dict example. Pickles load across main and 1.5.1 and this change both ways at protocols 0, 1, 2 and 5, except main's own FrameRecord pickles, a format no release wrote. Dumps and from_data rebuilds match main. New tests fail on main.
Owner
Author
|
GOOD TO GO at
|
Contributor
|
Coverage: 94.45% (unit tier, Python 3.15,
Per-file detail: the |
5 tasks done
JarryShaw
added a commit
that referenced
this pull request
Nov 3, 2026
- Breaking: FrameRecord is an Info and TLSKeyLog.entries a TLSKeyLogEntries data model, not dicts (#2734); a new entry with 1.5.1's behaviour, and pickles checked loading both ways. - Fixed: MH's CGA Parameters maker builds a data model's raw extension and a schema without public_key_test (#2732), into the makers' Fixed entry. - Fixed: a capture cut inside or in front of an option area reads as a short read in MH, HOPOPT and IPv6-Opts, and an odd item list raises ProtocolError (#2731, ab7be2f, which the merge of 07ceaf7 also brings in); the short-read ruling into the conventions entry. - Old values measured against v1.5.1. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
JarryShaw
added a commit
that referenced
this pull request
Nov 3, 2026
- Breaking: a short CALIPSO, SMF_DPD or MPL Opt Data Len raises ProtocolError, where 1.5.x raised FieldValueError, and a cut after the type octet reads short (#2737), a new entry; AppType.__registries__ is an Info, into the #2734 entry (#2735). - Changed: const packages import their enumerations lazily through pcapkit.utilities.lazy.lazy_exports (#2735); the docs extra pins sphinx-autodoc-typehints 3.17.4 (#2742), as 1.5.0 recorded its pin. - Fixed: the dumps keep a field renamed for clashing with an Info builtin name (#2736). - Folded: the GraalPy leg's timeout and shards into the CI-legs entry (#2741); the #2735 and #2737 rulings into the conventions entry. - No entry for the docs-only #2744 and #2746. - 1.6.0's :func:`bytes` role is :class:`bytes`, so the changelog pages build with no nitpicky warning. Old values measured against v1.5.1. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
1 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
refactor— changes neither behaviour nor performanceThis applies the owner's ruling against direct
dictsubclasses: useInfoorDatawhere they fit, especially inprotocols.data.FrameRecord, adictsubclass shipped in 1.5.x, becomes an@info_finalInfo. It still maps the engine's dissection by key, withpacket,frame_infoandtime_epochas attributes. It is immutable, and itsto_dict()exports only the mapping. Pickles written by 1.5.x still load.entries, a plaindict, becomesTLSKeyLogEntries(Data), re-exported asPCAPNG_TLSKeyLogEntries. A plain mapping converts on construction.to_dict()givesOrderedMultiDictcontainers for both, because the info round-trip test requires every export level to be one. Keys, values, the JSON, plist and tree dumps, and byte-exactfrom_dataare unchanged.MultiDictstays, per the owner._Registriesmoves in #2729, the same file._EnumRegistrywaits on the decision in #2726. Pickles load across 1.5.1,mainand this PR, apart from records thatmainpickled after #2722, which no release wrote.Part of #2726