Repository navigation
Method registered members carry an empty str payload, so Method.GET == GET is False #870
Description
Activity
- addedbugIssues reporting a defect (set by the bug report template; a default, not an assessment)Issues reporting a defect (set by the bug report template; a default, not an assessment)fixPull requests that fix a defect (fix: subject prefix)Pull requests that fix a defect (fix: subject prefix)constRegenerated IANA or vendor constant tables; members keep their numeric valuesRegenerated IANA or vendor constant tables; members keep their numeric values
on Sep 28, 2026 Checkable blocker: #869 must merge first. The fix here is in
pcapkit/const/http/method.py's__new__and its generatorpcapkit/vendor/http/method.py— the same two files #869 is currently editing, on head517b1775e. Two branches touching them concurrently would conflict, and the later write silently wins.gh pr view 869 -R JarryShaw/PyPCAPKit --json state,mergedAt -q '"\(.state) \(.mergedAt)"' gh api "repos/JarryShaw/PyPCAPKit/pulls/869/files?per_page=100" -q '.[].filename' | grep http/methodWhen that reports
MERGED, this unblocks and the work starts from whatever__new__looks like onmainat that point. #869 also lands the unregistered-member half of the same inconsistency, so the diff here shrinks to registered members only.- addedblockedDeferred pending another issue or decision; see the last comment for what unblocks itDeferred pending another issue or decision; see the last comment for what unblocks it
on Sep 28, 2026 - removedblockedDeferred pending another issue or decision; see the last comment for what unblocks itDeferred pending another issue or decision; see the last comment for what unblocks it
on Sep 28, 2026 Unblocked — #869 merged at 12:21:47Z as
60b85e3a4, and it was the only gate. Verified:gh pr view 869 --json state,mergedAt,mergeCommit -> MERGED 2026-09-28T12:21:47Z 60b85e3a4 git log --oneline -1 origin/main -> 60b85e3a4 fix(const,vendor): bring 8 bespoke registries onto EnumRegistry, stop them minting (#860) (#869)The two files this needs —
pcapkit/const/http/method.pyandpcapkit/vendor/http/method.py— are no longer being edited by another branch, so the conflict that held this is gone. #869 also landed the unregistered-member half of the same inconsistency, which is why the remaining scope here is registered members only:__new__atpcapkit/const/http/method.py:48still callsstr.__new__(cls)with no argument, so all 40 declared members carry an empty str payload while an unregistered one now carries its value. Dispatching work on it now.- addedwipWork in flight - a covering PR is open or an agent is actively on itWork in flight - a covering PR is open or an agent is actively on it
on Sep 28, 2026 - added 4 commits that reference this issue
on Sep 28, 2026 - removedwipWork in flight - a covering PR is open or an agent is actively on itWork in flight - a covering PR is open or an agent is actively on it
on Sep 28, 2026 - added 7 commits that reference this issue
on Sep 28, 2026
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
pcapkit.const.http.method.Methodis aStrEnum, but every registered member carries an emptystrpayload, so comparing one to its own value isFalse:Cause is
pcapkit/const/http/method.py:48, inside the class's own__new__:str.__new__(cls)with no second argument builds an empty string, so the member'sstrcontent never carries the value even though_value_does. Every one of the 40 registered members is affected. Reproduced onmainatc411d072aand on the current head of #869 alike — it predates both.Consequence: any caller treating a
Methodas the string it is (Method.GET == 'GET','%s' % Method.GET, an f-string, a dict keyed by the verb,str.startswith) silently sees an empty string. The.nameand.valueattributes are correct, which is why this has gone unnoticed.Note the interaction with #869: that PR gives unregistered members a real payload (
str(Method('frob')) == 'frob'), which leaves registered and unregistered members inconsistent until__new__is fixed here. Fixing it changes what 40 public members compare equal to, so it is a behaviour change in its own right and belongs in its own review rather than being folded into #869 — see #869 (comment).Check whether
pcapkit/const/ftp/command.py'sCommand.__new__and the other hand-rolled__new__s underpcapkit/const/have the same shape before fixing, and pin the result with a test assertingstr(member) == member.valuefor every member of every str-valued registry.