Repository navigation
fix(registry): re-registering a stored ModuleDescriptor keeps it (#1364) - #1415
Merged
Merged
Conversation
- ProtocolBase.register and the Internet, Link, Transport, SCTP, Frame and PCAPNG overrides resolved a ModuleDescriptor argument to its class before comparing it with the stored entry, so handing back the stored descriptor warned and replaced the deferred entry with the class. They now compare first: the stored entry, or a descriptor equal to it, is a silent no-op that keeps the stored object. A different entry still warns, and invalid input still raises RegistryError. - Extractor.register_dumper already keeps its shipped descriptors since #1376; it is pinned in the new test. New tests/protocols/test_registry_stored_descriptor_unit.py: 6 tests; 8 fail on origin/main (7 subtests and the ProtocolBase case).
JarryShaw
force-pushed
the
fix/1364-registry-descriptor
branch
from
October 8, 2026 13:29
cacef95 to
584d5b0
Compare
Owner
Author
|
Verdict: GOOD TO GO at
|
Contributor
|
Coverage: 89.43% (unit tier, Python 3.14,
Per-file detail: the |
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.
Searched for similar pull requests
Followed the coding style — ran
pylintandmypyon the seven files (no findings on touched lines);isortnot runmake testpasses, and a test case covers the change — legsfoundation,protocols --exclude protocols/internet,protocols/internet, plustests/projectChangelog entry — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657
fix— corrects a defectCloses #1364
ProtocolBase.registerand theInternet/Link/Transport/SCTP/Frame/PCAPNGoverrides now compare the argument with the stored entry before resolving aModuleDescriptor: the stored entry, or an equal descriptor, is a silent no-op that keeps it; a different entry still warns; invalid input still raises.Extractor.register_dumperwas already fixed by #1376 and is pinned only.Probe,
TCP.register(21, TCP.__proto__[21])(same for IPv4, Ethernet, SCTP, Frame, PCAPNG): before — 1 warning, entry becomes the class; after — 0 warnings, entryisthe stored descriptor.Tests: new
tests/protocols/test_registry_stored_descriptor_unit.py, 6 passed + 28 subtests; onorigin/main8 failed (SCTP alone reverted: 1). Legs: 522 / 1059 / 566 tests, 0 failures;tests/project399 passed, 1 skipped.