summaryrefslogtreecommitdiffstats
path: root/Doc/library/io.rst
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2014-10-18 00:32:43 (GMT)
committerRobert Collins <rbtcollins@hp.com>2014-10-18 00:32:43 (GMT)
commit933430ab69b051aa35130a3cf779528faca9b6f2 (patch)
treedf0df6807ba2f82cc56d034c54226a5f2628abc9 /Doc/library/io.rst
parentd20ec1b92196a01acf9bfb990329d06b4dee5c78 (diff)
downloadcpython-933430ab69b051aa35130a3cf779528faca9b6f2.zip
cpython-933430ab69b051aa35130a3cf779528faca9b6f2.tar.gz
cpython-933430ab69b051aa35130a3cf779528faca9b6f2.tar.bz2
Issue #17401: document closefd in io.FileIO docs and add to repr
closefd was documented in the open docs but not the matching FileIO class documented. Further, closefd, part of the core state for the object was not shown. In review it was noted that the open docs are a little confusing about the interaction between closefd and paths, so tweaked them at the same time.
Diffstat (limited to 'Doc/library/io.rst')
-rw-r--r--Doc/library/io.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 533ba9d..0054286 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -519,9 +519,12 @@ Raw File I/O
The *name* can be one of two things:
* a character string or :class:`bytes` object representing the path to the
- file which will be opened;
+ file which will be opened. In this case closefd must be True (the default)
+ otherwise an error will be raised.
* an integer representing the number of an existing OS-level file descriptor
- to which the resulting :class:`FileIO` object will give access.
+ to which the resulting :class:`FileIO` object will give access. When the
+ FileIO object is closed this fd will be closed as well, unless *closefd*
+ is set to ``False``.
The *mode* can be ``'r'``, ``'w'``, ``'x'`` or ``'a'`` for reading
(default), writing, exclusive creation or appending. The file will be