Skip to content

fix(corekit): skip a record by reading when the stream only claims to seek (#2108) - #2118

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2108-advance-trust-regular-files
Oct 24, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2108-advance-trust-regular-files

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — bug fixes

Description of your pull request and other information

Closes #2108. advance() in pcapkit/corekit/io.py skips the rest of a record. It chose seek or read with isinstance(file, SeekableReader) or not file.seekable(). On Windows a pipe claims seekable() and its seek does nothing (CPython gh-86768), so the skip left the stream where it was.

… seek (#2108)

advance() trusted seekable(), so a Windows pipe (seekable() True, seek a no-op)
handed to Frame(file) or PCAPNG(file) directly was 'skipped' without moving.
advance() uses it; extraction.py imports it from there.
@JarryShaw JarryShaw added bug Issues reporting a defect (set by the bug report template; a default, not an assessment) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 23, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at d6a6f3e52 (Sonnet review).

@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 23, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 23, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at d6a6f3e52.

This closes #2108.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.54% (unit tier, Python 3.15, d6a6f3e52, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 880 2618 866 92.12%
pcapkit/corekit 2589 75 816 37 96.48%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2936 23 1024 25 98.79%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17414 219 4574 185 98.14%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 473 7 136 5 98.03%
pcapkit/vendor 4432 1988 1018 167 51.87%

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

@JarryShaw
JarryShaw merged commit 3564c04 into main Oct 24, 2026
65 checks passed
@JarryShaw
JarryShaw deleted the fix/2108-advance-trust-regular-files branch October 24, 2026 00:20
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 24, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 24, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone 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)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(corekit): the record-skip helper trusts seekable() as the Extractor did before #2104

1 participant