This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Yi Ding, ned.deily, rbcollins, ronaldoussoren, vstinner
Date 2015-08-18.23:41:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439941274.48.0.252719091799.issue24891@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-08-18 23:41:14vstinnersetrecipients: + vstinner, ronaldoussoren, rbcollins, ned.deily, Yi Ding
2015-08-18 23:41:14vstinnersetmessageid: <1439941274.48.0.252719091799.issue24891@psf.upfronthosting.co.za>
2015-08-18 23:41:14vstinnerlinkissue24891 messages
2015-08-18 23:41:14vstinnercreate