You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(registry): re-registering a stored ModuleDescriptor warns and replaces it with the class #1364
Describe the bug ProtocolBase.register (pcapkit/protocols/protocol.py:770-772), the Internet / Link / Transport / Frame / PCAPNG overrides, and Extractor.register_dumper (pcapkit/foundation/extraction.py:421-425) resolve a ModuleDescriptor argument to its class before comparing it with the stored entry. When the argument is the stored descriptor itself, incumbent is not protocol is true, so it warns and the entry becomes the class (the deferred import is lost). The docstrings state that "an unresolved ModuleDescriptor incumbent counts as different from the class it names"; this issue is the narrower case where the same descriptor object is handed back.
To Reproduce TCP.register(21, TCP.__proto__[21]) warns, and TCP.__proto__[21] is then a class. Extractor.register_dumper('json', *Extractor.__output__['json']) warns, and the entry's first item is then a class.
Expected behavior
Compare before resolving (if protocol is incumbent: return), or compare incumbent.klass is protocol without replacing a descriptor by an equal class. #739 flagged the descriptor/class meeting as a caveat. Separate fix from the presence-only guards of the sibling issue.
Found by the round-trip audit of pcapkit/foundation. Run /tmp/rtissues/foundation-repro.py from the repo root (it prints pcapkit.__file__ first).
Found by the foundation round-trip audit (#1202). The repro was re-checked by an independent verifier, and I re-ran it on main at c9676c563.
Correction: still blocked, and I have not dispatched a worker. My last comment checked only protocol.py. The fix also has to change three files that open PRs are editing:
Still blocked, now on a different PR.#1373, #1376 and #1378 have merged. The PCAPNG registrar override in protocols/misc/pcapng.py is about to be edited by the PCAP-NG half of #1398. Blocked until#1398 merges.
Still blocked, now on a different PR. The fix also needs the PCAPNG registrar override in protocols/misc/pcapng.py, which the PCAP-NG follow-up worker for #1382–#1384, #1401, #1405 and #1406 is about to edit. Blocked until that PR merges.
Activity
JarryShaw commentedon Oct 7, 2026
Blocked until #1352 merges, because both edit
pcapkit/protocols/protocol.py, whereProtocol.registerresolves the descriptor (:764-770).JarryShaw commentedon Oct 7, 2026
Unblocked: #1352 has merged, and no open PR now edits
pcapkit/protocols/protocol.py. A worker is starting on it.JarryShaw commentedon Oct 7, 2026
Correction: still blocked, and I have not dispatched a worker. My last comment checked only
protocol.py. The fix also has to change three files that open PRs are editing:foundation/extraction.py(register_dumper), edited by fix(registry): foundation registrars restore the built-in a name shipped with (#1363) #1376;PCAPNGoverride inprotocols/misc/pcapng.py, edited by fix(pcapng): rebuilt blocks keep their lengths and padding (#1276, #1279, #1280, #1282, #1283, #1284) #1373 and fix(pcapng): blocks and options rebuild as parsed (#1272, #1273, #1277, #1278, #1281, #1286) #1378;Frameoverride inprotocols/misc/pcap/frame.py, edited by fix(pcapng): rebuilt blocks keep their lengths and padding (#1276, #1279, #1280, #1282, #1283, #1284) #1373.Blocked until #1373, #1376 and #1378 merge. All three are already good-to-go.
fix(registry): foundation registrars restore the built-in a name ship…
JarryShaw commentedon Oct 8, 2026
Still blocked, now on a different PR. #1373, #1376 and #1378 have merged. The
PCAPNGregistrar override inprotocols/misc/pcapng.pyis about to be edited by the PCAP-NG half of #1398. Blocked until #1398 merges.JarryShaw commentedon Oct 8, 2026
Still blocked, now on a different PR. The fix also needs the
PCAPNGregistrar override inprotocols/misc/pcapng.py, which the PCAP-NG follow-up worker for #1382–#1384, #1401, #1405 and #1406 is about to edit. Blocked until that PR merges.JarryShaw commentedon Oct 8, 2026
Unblocked: #1412 merged (
ec2ba13a4). A worker is on it now.fix(registry): re-registering a stored ModuleDescriptor keeps it (#1364)
fix(registry): re-registering a stored ModuleDescriptor keeps it (#1364…