mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-77046: os.pipe() sets _O_NOINHERIT flag on fds (#113817)
On Windows, set _O_NOINHERIT flag on file descriptors created by os.pipe() and io.WindowsConsoleIO. Add test_pipe_spawnl() to test_os. Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
e82b096335
commit
1d75fa43a2
5 changed files with 68 additions and 6 deletions
|
|
@ -75,10 +75,14 @@ File Operations
|
|||
.. function:: open_osfhandle(handle, flags)
|
||||
|
||||
Create a C runtime file descriptor from the file handle *handle*. The *flags*
|
||||
parameter should be a bitwise OR of :const:`os.O_APPEND`, :const:`os.O_RDONLY`,
|
||||
and :const:`os.O_TEXT`. The returned file descriptor may be used as a parameter
|
||||
parameter should be a bitwise OR of :const:`os.O_APPEND`,
|
||||
:const:`os.O_RDONLY`, :const:`os.O_TEXT` and :const:`os.O_NOINHERIT`.
|
||||
The returned file descriptor may be used as a parameter
|
||||
to :func:`os.fdopen` to create a file object.
|
||||
|
||||
The file descriptor is inheritable by default. Pass :const:`os.O_NOINHERIT`
|
||||
flag to make it non inheritable.
|
||||
|
||||
.. audit-event:: msvcrt.open_osfhandle handle,flags msvcrt.open_osfhandle
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue