On this page
posix.get_inheritable
Prev: posix.get_blocking | Up: posix | Next: posix.get_terminal_size
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.get_inheritable
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import get_inheritable
Signature & Overview
posix.get_inheritable(fd, /)
Get the close-on-exe flag of the specified file descriptor.
Usage
import os
r, w = os.pipe()
try:
assert os.get_inheritable(r) is False
finally:
os.close(r); os.close(w)
Gotchas
- PEP 446: New fds in Python 3.4+ are non-inheritable (
O_CLOEXEC) by default.
REPL Inspect
from posix import get_inheritable
help(get_inheritable)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/get_blocking Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/get_terminal_size Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posix/abort Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/access Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chdir Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chflags Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chmod shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chown shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chroot shared tags: #posix, #stdlib