Message347671
> os.dup() doc says: "On Windows, when duplicating a standard stream
> (0: stdin, 1: stdout, 2: stderr), the new file descriptor is
> inheritable."
That's not necessarily correct. For example, if stdout is a pipe or disk file:
C:\>python -V
Python 3.7.3
C:\>python -c "import os; fd = os.dup(1); print(os.get_inheritable(fd))" | more
False
C:\>python -c "import os; fd = os.dup(1); print(os.get_inheritable(fd))" > stdout.txt
C:\>type stdout.txt
False
What 3.7.3 does is to skip calling _Py_set_inheritable for all files of type FILE_TYPE_CHAR, which is wrong for character devices in general, such as NUL and serial ports. NUL is a common target for standard I/O redirection. |
|
Date |
User |
Action |
Args |
2019-07-11 11:02:44 | eryksun | set | recipients:
+ eryksun, paul.moore, vstinner, tim.golden, zach.ware, steve.dower, josh.r, ZackerySpytz, daveb |
2019-07-11 11:02:44 | eryksun | set | messageid: <1562842964.87.0.303022507805.issue37549@roundup.psfhosted.org> |
2019-07-11 11:02:44 | eryksun | link | issue37549 messages |
2019-07-11 11:02:44 | eryksun | create | |
|