Skip to content

test(foundation): close the patched-run Extractor before its TemporaryDirectory exits #2101

Closed

Description

@JarryShaw

Job 120605026883, the first Windows run of #2095's leg: 7 tests/foundation/test_extraction.py::ExtractorTests cases fail with WinError 32 on sample.pcap. They are the dict_capable…, real_frames…, auto_mode_call…, constructor_initialises…, pcap_trace_format_is_replaced… and the two warns_bullet_… cases.

With run patched out, _traced and its siblings close extractor._ifile through addCleanup or after the with TemporaryDirectory() block, so the directory is deleted while the file is still open. This is test-only; the library is fine here.

Proposed: close _ifile inside the with block.

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    testPull requests that add or correct tests (test: subject prefix)
    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. JarryShaw commented on Oct 23, 2026

    @JarryShaw
    OwnerAuthor

    Fixed on main as 41cdf1759 (test-only): the seven ExtractorTests cases now close extractor._ifile inside their TemporaryDirectory. test_extraction_tempdir_close_2101_unit makes TemporaryDirectory.cleanup fail as Windows does while a file in the directory is open; it fails on all seven without the change and passes with it.

  6. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 23, 2026
  7. 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)testPull requests that add or correct tests (test: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions