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(foundation): a Windows pipe passes seekable(), so its peeked octets are lost #2097
The first Windows run of #2095's leg (job 120605026883) fails 25 pipe cases in test_extraction_non_seekable_stream_1586_unit, including pcapkit - reading from stdin. PCAP reads its magic as b'\x02\x00\x04\x00', which is the version bytes at offset 4, so the bytes the peek consumed are lost.
Inferred, not yet probed on a runner: on a Windows pipe, seekable() returns True and seek silently does nothing. The Extractor.__init__ branch then skips the SeekableReader wrapper, and PeekableStream.peek's seek-back never rewinds. A one-line probe on the leg would confirm it.
Proposed: trust seekable() only for a regular file (stat.S_ISREG(os.fstat(fileno).st_mode)), and otherwise wrap in SeekableReader. This is a user-visible defect, so it blocks #2060 phase 2.
Activity
fix(foundation): treat only a regular file's seekable() as trustworthy (