docs(pcapng): repoint the generator's stale journal-defect citation - #793
Conversation
|
Labelled I asked whether So the citation was correct when written at Confirmed the behavioural claim on merged The fix does the right thing with the fixture: it keeps the alignment loop and says why — dropping it would change committed fixture bytes, which is wider than a citation fix — and flags removal as a follow-up rather than smuggling it in. It also replaces the bare number with the construct name plus issue links, which is the form that cannot drift; that is the pattern I would like the other instances of this defect class to follow. One correction to my own report a moment ago: my first attempt to run that test printed Cross-review dispatched on a different model from the author before I set a verdict. |
|
Cross-review at The padding defect was fixed by #699 (for #678), not by #728 (for #723). Verified four ways: So #728 moved that guard, it did not add it — the NUL-only-line check already existed. The reviewer bisected it:
Two things separate but true: the line number drifted because #728 rewrote the code, and the defect was fixed earlier by #699. My comment above conflated them. Second false claim: "committed bytes".
Also: "neither error nor warning" is literally false — The review confirmed the defect is gone, the fixture bytes are provably identical ( |
1c88384 to
3b977f8
Compare
`_journal_entry`'s docstring in examples/generators/pcapng.py cited pcapkit/protocols/schema/misc/pcapng.py:1376 for the padding-splitting defect its alignment workaround exists to avoid. That line number was correct when the comment was written, but the defect itself was fixed earlier than the citation implied and by a different change than first attributed here. - The fix is #699 (closing #678): it added the `not line.strip(b'\x00')` guard that ends a journal entry on its own NUL padding instead of misreading it as a binary field name. #728/#723 only moved that guard while rewriting the parser to walk `self.entry` instead of splitting it -- confirmed with `git log -S "strip(b'\x00')"` and by diffing 8af2cfd against 73b8cc8. #723 is about content shredded by the `b'\n\n'` split, a different symptom. - Cite the fix and the mechanism instead of a bare line number. - Say the workaround stays because dropping it regenerates the untracked `test.pcapng` fixture (examples/captures/* is gitignored), not because it touches committed bytes -- and say the measurement found no `SchemaWarning`, not "no warning": an unrelated `ExtractionWarning: EOF reached` fires on the aligned entry too. - Fix `_Blocks.journal`'s docstring, which credited "the caller" for padding `entry` when `_Blocks.block` does it. Measured directly: built a misaligned journal entry through the real _Blocks writer, bypassing _journal_entry's alignment loop, and parsed it with the current Extractor -- one entry, zero SchemaWarnings, on both the aligned and misaligned forms. make isort and pytest tests/protocols/misc/test_pcapng_unit.py (88 passed, 1 skipped, 1753 subtests) both clean. Closes #791
3b977f8 to
d6ade65
Compare
|
Delta re-check at
I skipped its third nit deliberately — restoring What it verified rather than accepted, on a tree proven with
It also confirmed nothing load-bearing went with the trim: the exact Setting |
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the changedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A — changelog centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingchore— anything elseDescription of your pull request and other information
The defect is gone, not merely mis-cited.
_journal_entry's docstringcited
pcapkit/protocols/schema/misc/pcapng.py:1376for asplit-without-stripping-padding defect. The line number was correct when
written, but the fix is
#699(closing#678), not#728/#723as anearlier revision of this PR claimed:
#699added thenot line.strip(b'\x00')guard;#728only moved it while rewriting theparser to walk instead of split.
#723is a different symptom (contentshredded by the
b'\n\n'split), confirmed withgit log -S "strip(b'\x00')"and by diffing8af2cfda7against73b8cc87f.Measured directly: built a misaligned journal entry through the real
_Blockswriter, bypassing_journal_entry's alignment loop, and parsed itwith the current
Extractor— one entry, zeroSchemaWarnings (an unrelatedExtractionWarning: EOF reachedfires on the aligned entry too, so it isn'tliterally warning-free).
The docstring now cites
#699and the mechanism rather than a bare linenumber. The workaround stays because dropping it regenerates the untracked
test.pcapngfixture (examples/captures/*is gitignored) — not because ittouches committed bytes, as an earlier revision said. Also fixed
_Blocks.journal's docstring, which credited "the caller" for paddingentrywhen_Blocks.blockdoes it.Swept every
path.py:Ncitation in the file — only this one exists; twoother pcapkit-internal references (not one) carry no line number and are
fine as-is.
Closes #791