Skip to content

Commit 7e1ca5d

Browse files
committed
Only reject FILE_TYPE_PIPE
1 parent c957d19 commit 7e1ca5d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Modules/posixmodule.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11931,11 +11931,10 @@ os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how)
1193111931
#ifdef MS_WINDOWS
1193211932
HANDLE h = (HANDLE)_get_osfhandle(fd);
1193311933
if (h != INVALID_HANDLE_VALUE) {
11934-
if (GetFileType(h) == FILE_TYPE_DISK) {
11935-
result = _lseeki64(fd, position, how);
11936-
} else {
11937-
// Only file is seekable
11934+
if (GetFileType(h) == FILE_TYPE_PIPE) {
1193811935
errno = ESPIPE;
11936+
} else {
11937+
result = _lseeki64(fd, position, how);
1193911938
}
1194011939
}
1194111940
#else

0 commit comments

Comments
 (0)