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(mh): decide whether the two kept get overrides should raise quietly like the base #933
FastBindingAcknowledgmentStatus.get and IPv6AddressPrefixCode.get (both in pcapkit/protocols/internet/mh.py) raise EnumKeyError on a name miss withoutquiet=True. The base does the opposite — EnumLookup.get raises with quiet=True at pcapkit/corekit/enum.py:412.
That divergence pre-dates #932 and is untouched by it, but #932 makes it newly reachable: re-parenting those two onto EnumLookup gives them an inherited get_all, which did not exist on them before and which routes a miss through the loud override. Measured on both trees:
post-#932 has get_all=True raised=EnumKeyError sys.tracebacklimit '<unset>' -> 0
pre-#932 has get_all=False raised=- sys.tracebacklimit '<unset>' -> '<unset>'
A loud BaseError sets sys.tracebacklimit = 0process-wide — the hazard behind #362 — so this is a public-API path that can now silently truncate every later traceback in the process. No non-test caller exists in pcapkit/ today, which is why #932 is not being held for it.
The decision I do not want to take inside a refactor: should these two overrides adopt the base's quiet=True?
No — a get_all miss is a genuine failure the caller should see loudly, and quiet=True on the base exists specifically because a name miss there is part of a successful call at Method.get. These overrides have no such caller, so the reasoning does not transfer.
Option 2 has the better argument on the code as it stands, so unless you say otherwise I would keep them loud, pin the behaviour with a test, and document why they differ. #932 already does the pinning and documenting, so this issue only decides whether the raise itself changes.
Surfaced by the Opus cross-review of #932 and verified independently.
FastBindingAcknowledgmentStatus.getandIPv6AddressPrefixCode.get(both inpcapkit/protocols/internet/mh.py) raiseEnumKeyErroron a name miss withoutquiet=True. The base does the opposite —EnumLookup.getraises withquiet=Trueatpcapkit/corekit/enum.py:412.That divergence pre-dates #932 and is untouched by it, but #932 makes it newly reachable: re-parenting those two onto
EnumLookupgives them an inheritedget_all, which did not exist on them before and which routes a miss through the loud override. Measured on both trees:A loud
BaseErrorsetssys.tracebacklimit = 0process-wide — the hazard behind #362 — so this is a public-API path that can now silently truncate every later traceback in the process. No non-test caller exists inpcapkit/today, which is why #932 is not being held for it.The decision I do not want to take inside a refactor: should these two overrides adopt the base's
quiet=True?get_allmiss is a genuine failure the caller should see loudly, andquiet=Trueon the base exists specifically because a name miss there is part of a successful call atMethod.get. These overrides have no such caller, so the reasoning does not transfer.Option 2 has the better argument on the code as it stands, so unless you say otherwise I would keep them loud, pin the behaviour with a test, and document why they differ. #932 already does the pinning and documenting, so this issue only decides whether the raise itself changes.
Surfaced by the Opus cross-review of #932 and verified independently.