Skip to content

docs(dumpkit): tree output is lossy -- decide whether to document it or fix the writer #1266

Closed

Description

@JarryShaw

Describe the bug
The tree dumper renders '', b'', None, {}, NO_VALUE and NULL all as NIL, so they cannot be told apart; a string containing a newline breaks the layout; and a complex value raises TypeError. Nothing in the docs says the tree format is lossy. This is a question rather than a confirmed defect: tree is a display format.

To Reproduce
make_dumper(dictdumper.Tree) over {'a': '', 'b': b'', 'c': None, 'd': {}, 'e': NO_VALUE, 'f': NULL} prints NIL for all six. {'a': 'x\ny'} prints |-- a -> x then y at column 0. {'c': 1+2j} raises TypeError: must be real number, not complex.
Repro: /tmp/rtissues/dumpkit-repro.py, check D12.

Expected behavior
Decide: state in the dumper docs that tree is a lossy display format, or give each of these a distinct rendering and escape newlines.

Found by the dumpkit round-trip audit (#1202). The repro was re-checked by an independent verifier, and I re-ran it on main at 11ae68ebf.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  2. added
    docsPull requests that change documentation only (docs: subject prefix)
    and removed
    fixPull requests that fix a defect (fix: subject prefix)
    on Oct 7, 2026
  3. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Decision needed: tree output is lossy. '', b'', None, {}, NO_VALUE and NULL all render as NIL. Newlines inside a string break the layout, and a complex value raises TypeError. Nothing in the docs says tree output is lossy.

    1. Document tree as a human-readable view only (recommended). State in the dumper docs that it is lossy, and stop complex from raising. JSON and plist stay the lossless formats under test: round-trip coverage for every protocol code, dumper and lossless path #1202.
    2. Make tree lossless. Give each empty or sentinel value a distinct rendering, and escape newlines. This changes tree output for every capture.

    My recommendation is (1): nothing parses tree output back, so it has no round trip to keep.

  4. added
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  5. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    take (1)

  6. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Ruling recorded: option (1). The tree dumper is documented as a lossy, human-readable view, JSON and plist remain the lossless formats under #1202, and a complex value will be rendered rather than raising.

    Blocked until #1305 merges, because the complex fix is in dumpkit/common.py, which #1305 edits.

  7. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Oct 7, 2026
  8. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1305 merged at 20:04Z, so the option-(1) work (document the tree dumper as lossy and stop complex from raising) can start. Back to pending.

  9. added
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  10. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 8, 2026
  11. added this to the PyPCAPKit v1.5 milestone on Oct 25, 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

    docsPull requests that change documentation only (docs: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions