Skip to content

Commit 25fede6

Browse files
review: update seekable ca
ching logic
1 parent 06cf12d commit 25fede6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎Modules/_io/fileio.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,13 @@ portable_lseek(fileio *self, PyObject *posobj, int whence, bool suppress_pipe_er
10131013
_Py_END_SUPPRESS_IPH
10141014
Py_END_ALLOW_THREADS
10151015

1016-
if (self->seekable < 0 && (res >= 0 || errno == ESPIPE || posobj == NULL)) {
1016+
if (self->seekable < 0
1017+
&& !(res < 0 && (errno == EINVAL
1018+
#ifdef EOVERFLOW
1019+
|| errno == EOVERFLOW
1020+
#endif
1021+
|| errno == ENXIO)))
1022+
{
10171023
self->seekable = (res >= 0);
10181024
}
10191025

0 commit comments

Comments
 (0)