[issue42602] seekable() returns True on pipe objects in Windows

2020-12-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Yes, despite that MSVCRT knows the type of the file descriptor because it calls GetFileType() on its creation, it doesn't check it in lseek() implementation and simply calls SetFilePointer(), which spuriously succeeds for pipes. MSDN says the following[1]:

[issue42602] seekable() returns True on pipe objects in Windows

2020-12-08 Thread Myungbae Son
New submission from Myungbae Son : >>> import os >>> r, w = os.pipe() >>> os.lseek(w, 10, 0) 10 >>> wf = open(w, 'w') >>> wf.seekable() True This happens on Windows. Consequently seek() works for these objects but they seems to be no-op. This may confuse libraries that depend on seeking. The