Eryk Sun <eryk...@gmail.com> added the comment:

Console input handles pose the same risk of hanging indefinitely when io.FileIO 
is used in legacy standard I/O mode (i.e. PYTHONLEGACYWINDOWSSTDIO).

Seeking could simply be disallowed on all files that aren't FILE_TYPE_DISK. For 
example, change portable_lseek() in Modules/_io/fileio.c to check the file type:

    if (GetFileType((HANDLE)_get_osfhandle(fd)) != FILE_TYPE_DISK) {
        errno = ESPIPE;
        res = -1;
    } else {
        res = _lseeki64(fd, pos, whence);
    }

----------
versions: +Python 3.10 -Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34780>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to