Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Deleting a snapshot attribute damages the cached committed frame #198

Done

Description

@tony

Summary

A caller can delete cursor from an immutable Snapshot. The terminal then returns the same damaged object to the next reader.

Reproduction

  1. Run this example from a libvt checkout.
uv run python - <<'PY'
from libvt import Terminal
from libvt.testing import serialize_vt_snapshot

term = Terminal(rows=1, cols=4)
term.feed(b"A")
frame = term.committed
del frame.cursor
print(term.committed is frame)
serialize_vt_snapshot(term)
PY

Expected

del frame.cursor raises AttributeError immediately. Reading or serializing the committed frame still succeeds.

Actual

The deletion succeeds and the identity check prints True. Serialization then raises AttributeError: 'libvt.terminal.Snapshot' object has no attribute 'cursor'.

Environment

Revisions tested

Linux aarch64, CPython 3.15.2, master 299c9d9 and omnibus 4c0bf02.

References

#2 introduced the snapshot and its assignment guard. The immutable SyncToken already rejects deletion. The snapshot owns this rule, so a regression should exercise deletion through a cached frame and check that another reader can still use it.

Activity

  1. added
    bug
    p3
    area:core
    topic:api
    topic:data-integrity
    python
    on Dec 5, 2026
  2. added a commit that references this issue on Dec 5, 2026
    84a5a21
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

    area:corebugp3pythontopic:apitopic:data-integrity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions