Message360070
This is related to https://bugs.python.org/issue17797, which is closed.
Using Python 3.7.4, Windows 10.0.18362, Visual Studio 2017 and running as a C Application. Py_Initialize() eventually calls is_valid_fd with STDIN. The behavior appears to cause both dup() and fstat() to hang indefinitely (using RELEASE MSVCRT DLLs, it works correctly using MSVCRT Debug DLLs). The call stack shows Windows is waiting for some Windows Event. The recommended patch in issue17797 will not work.
is_valid_fd appears to want to read the 'input' using a file descriptor. since both dup and fstat hang, I realized that isatty() would indicate if the file descriptor is valid and works for any predefined FD descriptor(STDIN-0, STDOUT-1, STDERR-2).
#if defined(MS_WINDOWS)
struct stat buf;
if (fd >= fileno(stdin) && fd <= fileno(stderr)) {
return (_isatty(fd) == 0 && errno == EBADF) ? 0 : 1;
}
else if (fstat(fd, &buf) < 0 && (errno == EBADF || errno == ENOENT))
return 0;
return 1;
#else |
|
Date |
User |
Action |
Args |
2020-01-15 18:55:56 | dhamilton | set | recipients:
+ dhamilton, paul.moore, tim.golden, zach.ware, steve.dower |
2020-01-15 18:55:56 | dhamilton | set | messageid: <1579114556.26.0.996943969176.issue39345@roundup.psfhosted.org> |
2020-01-15 18:55:56 | dhamilton | link | issue39345 messages |
2020-01-15 18:55:55 | dhamilton | create | |
|