Skip to content

fix(traceflow): report the output path for open flows when the extension is empty (#2237) - #2246

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2237-traceflow-submit-fpout
Oct 26, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2237-traceflow-submit-fpout

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — bug fix

Description

Closes #2237. With a dumper whose extension is '', TCP.submit reported fpout=None for open flows (if self._fdpext), while trace had written {root}/{label} and _finalise (is not None) reported it.

  • Fix: a TCP._output_path(label) helper returns None only when the format writes no file (NotImplementedIO). submit and _finalise both use it. The fpout docs in Index and traceflow/tcp.rst match.
  • Test: test_an_empty_extension_reports_the_written_file_open_or_finalised in tests/foundation/traceflow/test_tcp.py. The file exists, and fpout matches it both mid-capture and after finish.
  • Fail-without-fix: on origin/main, None != '/tmp/…/192.0.2.1_12345-198.51.100.2_443-1.25'.
  • Tests run: tests/foundation/traceflow gives 39 passed, the extraction tests 37 passed, and the docstring contract and tier guard 140 passed.

…ion is empty (#2237)

TCP.submit guarded the open-flow fpout on a truthy extension, while
_finalise checked `is not None`. A dumper registered with an empty
extension writes `{root}/{label}`, so submit reported None for every
open flow that _finalise later reported by path.

Both now build fpout through TCP._output_path, which returns None only
when the format writes no file. The Index.fpout docs say so.

Test: test_an_empty_extension_reports_the_written_file_open_or_finalised
reads fpout mid-capture and after finish.
@JarryShaw JarryShaw added bug Issues reporting a defect (set by the bug report template; a default, not an assessment) fix Pull requests that fix a defect (fix: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
@JarryShaw JarryShaw added the review: running A cross-review is in flight against the current head - no verdict yet label Oct 26, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at becf67245 (Sonnet).

  • Repro: on main, fpout is [None, None] mid-capture while both flow files exist. On the head, mid-capture and final agree.
  • Unsupported formats: a NotImplementedIO format (trace_format='bogus') still reports None. json and pcap report their paths.
  • Fail-without-fix: None != '/tmp/…' on main. _fdpext is read only in tcp.py, and both sites go through _output_path.
  • Tests: traceflow, the docstring contract and the tier guard give 179 passed. The extraction and traceflow integration tests give 141 passed.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.56% (unit tier, Python 3.15, becf67245, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 881 2618 867 92.11%
pcapkit/corekit 2589 74 816 37 96.51%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2998 23 1040 25 98.81%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17433 218 4584 185 98.15%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 504 7 146 5 98.15%
pcapkit/vendor 4432 1988 1018 167 51.87%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at becf67245. Closes #2237.

  • Review: Sonnet GOOD TO GO, first round.
  • CI: all checks complete, Required checks passed SUCCESS, 0 failed.
  • KTLO: 12 legs, no warnings.
  • Ordering: merged into main and run. foundation leg: 741 tests, 0 failures.
  • Conflicts: none against the current main.

@JarryShaw
JarryShaw merged commit 55bbbb4 into main Oct 26, 2026
70 checks passed
@JarryShaw
JarryShaw deleted the fix/2237-traceflow-submit-fpout branch October 26, 2026 14:52
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 26, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issues reporting a defect (set by the bug report template; a default, not an assessment) fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(traceflow): TCP.submit reports fpout None for an empty-extension dumper that _finalise reports

1 participant