]> granicus.if.org Git - python/commitdiff
#14863: Update the documentation of os.fdopen()
authorPetri Lehtinen <petri@digip.org>
Thu, 24 May 2012 18:44:07 +0000 (21:44 +0300)
committerPetri Lehtinen <petri@digip.org>
Thu, 24 May 2012 18:46:36 +0000 (21:46 +0300)
There's no bufsize argument anymore, and os.fdopen() is only a very
thin wrapper around open() anymore. Change the documentation to
reflect that.

Doc/library/os.rst
Misc/NEWS

index 3f433387c8a13607d208e492f1ba3f1a6e1b24c0..5991e29de577ff3934075553179d98e358f09cac 100644 (file)
@@ -545,22 +545,12 @@ 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*.  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'``, 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.
+   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.
 
 
 .. _os-fd-ops:
index d9b8b5cf846c700b19fae7adbdcf87529bb42a94..efec480d6dc3d6d19a164bdac6f0f0ed2b72118b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -67,6 +67,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #14863: Update the documentation of os.fdopen() to reflect the
+  fact that it's only a thin wrapper around open() anymore.
+
 - Issue #14036: Add an additional check to validate that port in urlparse does
   not go in illegal range and returns None.