diff options
author | Petri Lehtinen <petri@digip.org> | 2012-05-24 18:49:59 (GMT) |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2012-05-24 18:49:59 (GMT) |
commit | fa52cbd5e6210f257de40aab12d55d84d64bdb91 (patch) | |
tree | bfb8e8d61d0d7ea05f7a29d1856654ed68982668 /Doc/library/os.rst | |
parent | 4715ca560004b6df0d573084a07a9355b7ac189f (diff) | |
parent | 1a01ebc41cbbfc127865f82656879a58c2560543 (diff) | |
download | cpython-fa52cbd5e6210f257de40aab12d55d84d64bdb91.zip cpython-fa52cbd5e6210f257de40aab12d55d84d64bdb91.tar.gz cpython-fa52cbd5e6210f257de40aab12d55d84d64bdb91.tar.bz2 |
#14863: Update the documentation of os.fdopen()
Diffstat (limited to 'Doc/library/os.rst')
-rw-r--r-- | Doc/library/os.rst | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 8cc43c5..153a111 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -600,26 +600,13 @@ File Object Creation These functions create new :term:`file objects <file object>`. (See also :func:`open`.) -.. function:: fdopen(fd[, mode[, bufsize]]) +.. function:: fdopen(fd, *args, **kwargs) - .. index:: single: I/O control; buffering + Return an open file object connected to the file descriptor *fd*. + This is an alias of :func:`open` and accepts the same arguments. + The only difference is that the first argument of :func:`fdopen` + must always be an integer. - Return an open file object connected to the file descriptor *fd*. The *mode* - and *bufsize* arguments have the same meaning as the corresponding arguments to - the built-in :func:`open` function. - - When specified, the *mode* argument must start with one of the letters - ``'r'``, ``'w'``, ``'x'`` or ``'a'``, otherwise a :exc:`ValueError` is - raised. - - On Unix, when the *mode* argument starts with ``'a'``, the *O_APPEND* flag is - set on the file descriptor (which the :c:func:`fdopen` implementation already - does on most platforms). - - Availability: Unix, Windows. - - .. versionchanged:: 3.3 - The ``'x'`` mode was added. .. _os-fd-ops: |