STINNER Victor added the comment: I can reproduce the bug with gdb if the file descriptor 0 is closed before calling: std = create_stdio(iomod, fd, 0, "<stdin>", encoding, errors); and after the following lines were called: fd = fileno(stdin); if (!is_valid_fd(fd)) {
In initstdio () at Python/pylifecycle.c:1156. create_stdio() fails in FileIO constructor, on the line: if (_Py_fstat(self->fd, &fdfstat) < 0) of _io_FileIO___init___impl() at Modules/_io/fileio.c:480 It's a corner case of the issue #7111, I would call it a race condition. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24891> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com