Repository navigation
fix(protocols): revert #2432's RegistryError message to name Protocol - #2434
Conversation
#2432 (round 10 of #1103) changed register's RegistryError message from "...must be a Protocol subclass" to "...must be a ProtocolBase subclass" in pcapkit/protocols/protocol.py and foundation/registry/protocols.py, and updated the locked assertions in tests/protocols/test_register_class_guard_unit.py and tests/foundation/registry/test_protocols.py to match. This was a mistake. * The wording naming Protocol (not ProtocolBase) is a deliberate, ratified decision: #1016 ruled the message's reader is third-party code, who should be told to subclass Protocol -- ProtocolBase's own docstring says it is "for internal use only". The owner approved that reasoning, #2316 re-confirmed it as out of scope to change, and #2420's commit explicitly records "the error message names Protocol" as the kept half of the split between the Raises: clause (ProtocolBase) and the raised message (Protocol). #2420 also notes it already caught and corrected one prior accidental flip of this exact wording. * Reverted both raise sites and the four locked test assertions back to "Protocol subclass". * Also fixed a citation left by #2432: tests/foundation/reassembly/ test_deferred_pickle_2423_unit.py cited :issue:`2424` (the merged PR, not an issue) where it meant the underlying fix, tracked as #2423 -- matches the file's existing :issue:`2423` citation style and the changelog's own "(:issue:`2423`, :issue:`2425`, :pr:`2424`)" citation. #2432's other two fixes (a stale docstring, a cross-reference to a moved EnumField) are correct and untouched. Refs #1016, #2316, #2420 Refs #1103 Build: tests/protocols/test_register_class_guard_unit.py, tests/foundation/registry/test_protocols.py, tests/foundation/reassembly/test_deferred_pickle_2423_unit.py pass; full tests/project/ run shows no new failures (13 pre-existing failures, all in unrelated subprocess/network-dependent tests, none touching these files).
|
Review: GOOD TO GO at
Independently confirmed: the ruling itself (#1016/#2316, with the caveat that it's one shared login throughout), the diff has no scope creep (5 files, 6 lines each way, byte-exact against pre-#2432), the citation fix is correct, the raised message text is restored ( |
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix-- corrects a defectDescription
#2432 (round 10 of #1103) mistakenly changed
register'sRegistryErrormessagefrom "...must be a Protocol subclass" to "...must be a ProtocolBase subclass"
in
pcapkit/protocols/protocol.pyandfoundation/registry/protocols.py, andupdated the three locked assertions in
tests/protocols/test_register_class_guard_unit.py(two) and
tests/foundation/registry/test_protocols.py(one) to match.Naming
Protocol(notProtocolBase) in that message is a deliberate, ratifieddecision, not stale prose: #1016 ruled the message's reader is third-party code
that should be told to subclass
Protocol, sinceProtocolBase's own docstringsays it is "for internal use only". #2316 re-confirmed this is out of scope to
change. #2420's merge commit records the split directly: "The
Raises:clauseof each
registerkeeps naming ProtocolBase, unchanged... the raised messagenames Protocol."
git log -Son both wordings shows #2432 is the only committhat ever flipped the message; #2420 only touched the
Raises:docstringclause, never the message. This PR reverts both raise sites and the three
locked test assertions back to
Protocol subclass.Also fixes a citation #2432 left behind:
tests/foundation/reassembly/ test_deferred_pickle_2423_unit.pycited:issue:2424(the merged PR, not an issue) where the sentence means the underlying fix, tracked as #2423 -- now `:issue:`2423, matching the file's own existing citation style and thechangelog's
(:issue:2423, :issue:2425, :pr:2424).#2432's other two fixes (a stale PR-history docstring, a cross-reference to a
moved
EnumField) were correct and are untouched.Refs #1016, #2316, #2420, #1103