Skip to content

fix(foundation): Extractor keeps its input open when the constructor's run() raises #2100

Closed

Description

@JarryShaw

Job 120605026883, the first Windows run of #2095's leg: test_a_packet_block_before_any_interface_fails_as_from_a_file hits WinError 32 when deleting capture.pcap.

When the engine raises FormatError out of Extractor.__init__ → run → record_frames, only a KeyboardInterrupt calls _cleanup(), so the opened input stays open until GC. The exception the test holds keeps it alive. POSIX hides this because an open file can still be unlinked.

Proposed: in __init__, wrap self.run() as try: ... except BaseException: self._cleanup(); raise.

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 23, 2026
  2. moved this to Pending in PyPCAPKiton Oct 23, 2026
  3. 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 23, 2026
  4. moved this from Pending to WIP in PyPCAPKiton Oct 23, 2026
  5. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 23, 2026
  6. added this to the PyPCAPKit v1.5 milestone on Oct 26, 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