[Python-checkins] cpython (merge 3.2 -> default): #14863: Update the documentation of os.fdopen()
petri.lehtinen
python-checkins at python.org
Thu May 24 20:53:01 CEST 2012
http://hg.python.org/cpython/rev/f27e098a774a
changeset: 77123:f27e098a774a
parent: 77121:b4d257c64db7
parent: 77122:9ef2cb56926d
user: Petri Lehtinen <petri at digip.org>
date: Thu May 24 21:49:59 2012 +0300
summary:
#14863: Update the documentation of os.fdopen()
files:
Doc/library/os.rst | 27 +++++++--------------------
Misc/NEWS | 3 +++
2 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -600,26 +600,13 @@
These functions create new :term:`file objects <file object>`. (See also :func:`open`.)
-.. function:: fdopen(fd[, mode[, bufsize]])
-
- .. 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'``, ``'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.
+.. function:: fdopen(fd, *args, **kwargs)
+
+ 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:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -42,6 +42,9 @@
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.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list