Repository navigation
fix(dumpkit): JSON output for test.pcapng does not parse - #1158
Merged
Merged
Conversation
dictdumper.JSON escapes string values but writes a mapping key into
'"{item}": ' raw, so the bytes-repr client random keying test.pcapng's
TLS key log entries (it holds '"' and '\') closed the JSON string early.
make_dumper's escape_key now JSON-escapes keys for JSON output, in both
the MultiDict and plain-dict branches.
Closes #1152
Owner
Author
|
Cross-review verdict on
Unflagged change: a plain |
Contributor
|
Coverage: 88.75% (unit tier, Python 3.14,
Per-file detail: the |
JarryShaw
added a commit
that referenced
this pull request
Oct 6, 2026
- 22 new 1.5.0 entries for the 30 PRs merged since b10e795 (#1106-#1158), with related fixes grouped per the #918 ruling; three marked breaking to match their labels (#1116, #1138, #1145) - regenerate CHANGELOG.md with util/changelog_md.py - process.rst: entry-count pin re-measured, 167 -> 189 - pep.rst: note the plist round-trip test skipped on the upstream dictdumper fractional-second <date> defect (DictDumper#122) tests/project: conventions_doc_claims, changelog_md and documentation_claims pass; changelog_md.py --check is in step.
This was referenced Oct 15, 2026
JarryShaw
added a commit
that referenced
this pull request
Oct 16, 2026
…) (#1809) - Drop the "blocked on dictdumper" skip from PcapngUnescapedKeyTests.test_json_report_of_a_decryption_secrets_block_parses. #1158 made pcapkit.dumpkit escape JSON mapping keys itself, so the test.pcapng report parses although dictdumper 0.8.4.post6 still writes keys raw (JarryShaw/DictDumper#121). - Give the class the HAS_RUNTIME guard its siblings carry; _helpers.py to match. - Rewrite the class and test docstrings to say what the test now guards, citing symbols instead of the stale pcapng.py:2244 / common.py:351 lines, and fix the PCAPNG_SECTIONS comment that called the report unreadable. Bite: with escape_key's JSON branch returning the key unchanged, the test fails with "JSONDecodeError: Expecting ':' delimiter"; restored, it passes. The file, tests/project and tests/test_tier_guard.py pass. Closes #1795
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort) — ran pylint/mypy/isort on the touched files directly; no new mypy errors incommon.pymake testpasses, and a test case covers the change — ran only the modules listed belowWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1152.
dictdumper.JSON._append_objectwrites a mapping key as'"{item}": 'with no escaping.test.pcapng's TLS key log is keyed by abytesclient random whose repr holds"and\.make_dumper'sescape_keynow JSON-escapes keys for JSON output (json.dumps(...)[1:-1]), alongside its existing XML escaping for plist. Thedictdumperdefect is still there upstream.Probe (
extract(format='json')+json.load): beforeExpecting ':' delimiter: line 1019 column 12; afterOK. A sweep of all 23examples/captures/*now gives json 23/23 parsing (was 22/23) and plist 23/23 parsing with ElementTree. Tree writes all 23.Tests: new
tests/dumpkit/test_json_key_escaping_unit.py(3 tests) and..._regression.py(1 test).test_plist_escaping_regression.pyasserted the raw key in the JSON text, i.e. the broken output, so it now asserts the key's JSON spelling. With the fix reverted: unit 2 failed / 1 passed (the tree guard), regression 1 failed at line 1019, plist module 1 failed. With the fix, all pass, plustest_common_unit14,test_nameless_enum_rendering_unit6,integration/test_output_formats13 + 1 skipped,integration/test_pcapng_end_to_end6 + 1 skipped, andtests/project385 + 1 skipped.