You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(corekit): copying or pickling PeekableStream recurses until RecursionError #1524
On main5f4da2301, both copy.copy(_PeekableStream(io.BytesIO(b'abc'))) and a pickle round trip raise RecursionError: maximum recursion depth exceeded. I measured both.
Cause:__getattr__ forwards to self._stream. copy and pickle create the instance without calling __init__, so _stream is unset, and reading it re-enters __getattr__.
Fix:__getattr__ should raise AttributeError for _stream itself (or for any dunder) instead of forwarding. Add copy and pickle tests.
The #1521 review found this. #1521 makes the class public as pcapkit.corekit.io.PeekableStream, so the fix belongs there. Blocked until #1521 merges.
Activity
JarryShaw commentedon Oct 10, 2026
Unblocked: #1521 has merged, so the class now lives at
pcapkit.corekit.io.PeekableStream. A worker is on the fix.fix(corekit): copying or pickling a stream proxy no longer recurses (#…