Skip to content

fix(hip): 12 list-argument makers can't resolve a str enum name either #2394

Closed

Description

@JarryShaw

Follow-up to #2356/#2393. _make_index's str-name resolution bug (an argument whose own default is None, so its enum namespace can't be inferred) was fixed in #2393 for the 5 sites listed in #2356 (hopopt/ipv6_opts's _make_opt_mpl/_make_opt_smf_dpd, httpv1's _make_start_line).

A wider AST scan during that fix found a separate 12-site family in pcapkit/protocols/internet/hip.py, same symptom but a different shape: the name is a loop variable over a list parameter (e.g. _make_param_dh_group_list(groups=['Group_384_bit_group'])), so _make_index_namespace's isinstance(value, str) check can't match the list. Confirmed broken by measurement: the member form of the same call builds the correct bytes, the string-name form raises ProtocolNotImplemented.

Affected makers: _make_param_dh_group_list, _make_param_hip_transform, _make_param_hip_cipher, _make_param_nat_traversal_mode, _make_param_hit_suite_list, _make_param_reg_info, _make_param_reg_request, _make_param_reg_response, _make_param_reg_failed, _make_param_transport_format_list, _make_param_esp_transform, _make_param_hip_transport_mode.

Not mechanical: of the 9 enums these need, 5 (Enum_Suite, Enum_NATTraversal, Enum_Registration, Enum_ESPTransformSuite, Enum_Transport) are currently imported only under TYPE_CHECKING in hip.py. Fixing this means promoting those imports to runtime — a real decision (possible import-cycle implications), not a one-line namespace=X if X is not None else Y patch.

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    on Oct 27, 2026
  2. added
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 27, 2026
  3. added this to the PyPCAPKit v1.5 milestone on Oct 27, 2026
  4. moved this to Pending in PyPCAPKiton Oct 27, 2026
  5. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 27, 2026
  6. moved this from Pending to WIP in PyPCAPKiton Oct 27, 2026
  7. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 27, 2026
  8. moved this from WIP to Pending in PyPCAPKiton Oct 27, 2026
  9. moved this from Pending to Done in PyPCAPKiton Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions