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(foundation): a registrar given a non-enum code raises after registering it #2186
What fails: the method-name registrars in pcapkit/foundation/registry/protocols.py register first and then log code.name. A code that is not an enum member (an int, None) therefore raises AttributeErrorafter the protocol's registry has already been changed.
Repro on main4c3d30163:
frompcapkit.foundation.registry.protocolsimportregister_ipv4_optionfrompcapkit.protocols.internet.ipv4importIPv4register_ipv4_option(250, 'lsr') # AttributeError: 'int' object has no attribute 'name'250inIPv4.__option__# True: the entry is left behind
Expected: a bad code is rejected with an in-library error before anything is registered, or the int is accepted and logged without .name. Either way, a failed call leaves the registry unchanged.
Scope: every registrar using the same logger.debug(..., code.name) after the register call. Only the IPv4 one is reproduced.
Test: for each registrar, a bad code raises without changing the registry.
Activity
fix(foundation): validate a registrar's code before registering it (#…
fix(foundation): validate a registrar's code before registering it (#…
docs(changelog): sixth whole-repo pass over changelog (#1103)
docs(changelog): sixth whole-repo pass over changelog (#1103) (#2209)
docs(protocols,foundation,tests): state current behaviour in maker, r…
docs(protocols,foundation,tests): state current behaviour in maker, r…
docs(protocols,foundation,tests): state current behaviour in maker, r…
docs(protocols,foundation,tests): state current behaviour in maker, r…
docs: #719-style prose sweep after the #1090-1102 defect wave (#2408)