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
#711 fixes the "overwriting X with X" message for register_protocol (#710). The same defect exists in nine sibling registrars, and in them it is worse.
The nine sites
All on main at 3904c025a, all rendering {incumbent!r} with {protocol!r}:
File
Line
Keyed by
pcapkit/protocols/protocol.py
805
code
pcapkit/protocols/internet/internet.py
166
code
pcapkit/protocols/link/link.py
146
code
pcapkit/protocols/transport/transport.py
117
port
pcapkit/protocols/transport/sctp.py
630
payload protocol identifier
pcapkit/protocols/misc/pcap/frame.py
153
code
pcapkit/protocols/misc/pcapng.py
887
code
pcapkit/protocols/schema/schema.py
1127
_code
pcapkit/protocols/schema/schema.py
1180
code
These reprs were added by #695. Before it, these sites interpolated only the key and could not exhibit #710.
Why it is worse here than in register_protocol
The guards differ. register_protocol tests difference:
Splitting them matters: (1) alone removes most of the confusing output, and (2) alone leaves the misleading no-op warning in place.
Provenance
Found by the cross-review of #711 at #711 (comment), which correctly identified nine siblings but cited them under pcapkit/foundation/registry/ paths that do not exist, with every line number off by one. The table above is re-derived from origin/main directly.
#711 fixes the "overwriting X with X" message for
register_protocol(#710). The same defect exists in nine sibling registrars, and in them it is worse.The nine sites
All on
mainat3904c025a, all rendering{incumbent!r} with {protocol!r}:pcapkit/protocols/protocol.pycodepcapkit/protocols/internet/internet.pycodepcapkit/protocols/link/link.pycodepcapkit/protocols/transport/transport.pypcapkit/protocols/transport/sctp.pypcapkit/protocols/misc/pcap/frame.pycodepcapkit/protocols/misc/pcapng.pycodepcapkit/protocols/schema/schema.py_codepcapkit/protocols/schema/schema.pycodeThese reprs were added by #695. Before it, these sites interpolated only the key and could not exhibit #710.
Why it is worse here than in
register_protocolThe guards differ.
register_protocoltests difference:All nine siblings test presence:
So a sibling emits "overwriting X with X" in two distinct situations that the message cannot tell apart:
repr— the RegistryWarning claims a protocol was overwritten with itself when two distinct classes share a qualname #710 shape, where the warning is correct but unreadable.register_protocol's identity guard (added in #681) already suppresses case 2. The siblings have no equivalent.Suggested fix
Two independent changes, in this order:
Splitting them matters: (1) alone removes most of the confusing output, and (2) alone leaves the misleading no-op warning in place.
Provenance
Found by the cross-review of #711 at #711 (comment), which correctly identified nine siblings but cited them under
pcapkit/foundation/registry/paths that do not exist, with every line number off by one. The table above is re-derived fromorigin/maindirectly.