From: Serhiy Storchaka Date: Sun, 13 Oct 2013 17:13:37 +0000 (+0300) Subject: Issue #19207: Improved cross-references in the os, os.path, and posix modules X-Git-Tag: v3.4.0a4~123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=690a6a95bda2379dda200d6677b664b6e7004929;p=thirdparty%2FPython%2Fcpython.git Issue #19207: Improved cross-references in the os, os.path, and posix modules documentation. --- 690a6a95bda2379dda200d6677b664b6e7004929 diff --cc Doc/library/os.path.rst index 6e1d4942c746,36f2d14b0a44..25cae6b962e0 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@@ -271,14 -273,11 +271,14 @@@ the :mod:`glob` module. .. function:: samestat(stat1, stat2) Return ``True`` if the stat tuples *stat1* and *stat2* refer to the same file. - These structures may have been returned by :func:`fstat`, :func:`lstat`, or - :func:`stat`. This function implements the underlying comparison used by - :func:`samefile` and :func:`sameopenfile`. + These structures may have been returned by :func:`os.fstat`, + :func:`os.lstat`, or :func:`os.stat`. This function implements the + underlying comparison used by :func:`samefile` and :func:`sameopenfile`. - Availability: Unix. + Availability: Unix, Windows. + + .. versionchanged:: 3.4 + Added Windows support. .. function:: split(path) diff --cc Doc/library/os.rst index 2e46194e57c2,59457f75acd7..466f2426d447 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@@ -1201,49 -1189,6 +1201,49 @@@ Querying the size of a termina Height of the terminal window in characters. +.. _fd_inheritance: + +Inheritance of File Descriptors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 3.4 + +A file descriptor has an "inheritable" flag which indicates if the file descriptor +can be inherited by child processes. Since Python 3.4, file descriptors +created by Python are non-inheritable by default. + +On UNIX, non-inheritable file descriptors are closed in child processes at the +execution of a new program, other file descriptors are inherited. + +On Windows, non-inheritable handles and file descriptors are closed in child +processes, except for standard streams (file descriptors 0, 1 and 2: stdin, stdout - and stderr), which are always inherited. Using :func:`os.spawn*` functions, ++and stderr), which are always inherited. Using :func:`spawn\* ` functions, +all inheritable handles and all inheritable file descriptors are inherited. +Using the :mod:`subprocess` module, all file descriptors except standard +streams are closed, and inheritable handles are only inherited if the +*close_fds* parameter is ``False``. + +.. function:: get_inheritable(fd) + + Get the "inheritable" flag of the specified file descriptor (a boolean). + +.. function:: set_inheritable(fd, inheritable) + + Set the "inheritable" flag of the specified file descriptor. + +.. function:: get_handle_inheritable(handle) + + Get the "inheritable" flag of the specified handle (a boolean). + + Availability: Windows. + +.. function:: set_handle_inheritable(handle, inheritable) + + Set the "inheritable" flag of the specified handle. + + Availability: Windows. + + .. _os-file-dir: Files and Directories