Skip to content

from pcapkit.protocols.data import * raises AttributeError (HOPOPT_QuickStartOption) #515

Description

@JarryShaw

A plain star-import of a public subpackage fails. Reproduced against 27bb315d5:

>>> from pcapkit.protocols.data import *
AttributeError: module 'pcapkit.protocols.data' has no attribute 'HOPOPT_QuickStartOption'

pcapkit/protocols/data/__init__.py:95 lists 'HOPOPT_QuickStartOption' in __all__, but the name is never bound:

'HOPOPT_QuickStartOption' in __all__ : True
hasattr(module, it)                  : False
IPv4_QuickStartRequestOption         : True
IPv6_Opts_QuickStartRequestOption    : True

Cause

Commit 1831bb60b (2023-03-06) split QuickStartOption into Request/Report variants in the child module. The parent's __all__ was updated for the IPv4_ and IPv6_Opts_ families but not the HOPOPT_ one.

Broken for ~3.5 years, which suggests nothing in CI star-imports this package.

Related omissions found in the same sweep

  • pcapkit/protocols/schema/__init__.py.__all__ omits all 18 HOPOPT* names while listing all 18 IPv6_Opts* equivalents. Verified: hasattr(schema, 'HOPOPT') is True, 'HOPOPT' in schema.__all__ is False. git log -S HOPOPT on that file is empty — they were never added.
  • 'ESP' is missing from both protocols.data.__all__ and protocols.schema.__all__ though present as an attribute in both, in both children, and in pcapkit.__all__ (from bdb7e5971, Implement ESP, with optional payload decryption #378). Also missing: 'Data', and 'Schema'/'EnumSchema'/'schema_final'.
  • pcapkit/foundation/registry/__init__.py omits 6 functions that carry .. autofunction:: directives at docs/source/.../registry.rst:32-45.

Suggested fix

The one-word fix for the AttributeError, plus a guard test so the class cannot rot again — the house pattern already exists at tests/interface/test_core.py:238-251. A test that star-imports every public subpackage would have caught all of the above.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions