summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2012-01-14 10:51:00 (GMT)
committerCharles-François Natali <neologix@free.fr>2012-01-14 10:51:00 (GMT)
commitd612de10e551751c44c1772a027fe6953ae04f99 (patch)
tree8565f2c4cf1527b511cc4337c9009e051a759eb3 /Doc/library
parent138f4656e38f656afa7436c306aa74f1d4941216 (diff)
downloadcpython-d612de10e551751c44c1772a027fe6953ae04f99.zip
cpython-d612de10e551751c44c1772a027fe6953ae04f99.tar.gz
cpython-d612de10e551751c44c1772a027fe6953ae04f99.tar.bz2
Issue #12760: Refer to the new 'x' open mode as "exclusive creation" mode.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/io.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 82969eb..e1268cb 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -472,12 +472,12 @@ Raw File I/O
to which the resulting :class:`FileIO` object will give access.
The *mode* can be ``'r'``, ``'w'``, ``'x'`` or ``'a'`` for reading
- (default), writing, creating or appending. The file will be created if it
- doesn't exist when opened for writing or appending; it will be truncated
- when opened for writing. :exc:`FileExistsError` will be raised if it already
- exists when opened for creating. Opening a file for creating implies
- writing, so this mode behaves in a similar way to ``'w'``. Add a ``'+'`` to
- the mode to allow simultaneous reading and writing.
+ (default), writing, exclusive creation or appending. The file will be
+ created if it doesn't exist when opened for writing or appending; it will be
+ truncated when opened for writing. :exc:`FileExistsError` will be raised if
+ it already exists when opened for creating. Opening a file for creating
+ implies writing, so this mode behaves in a similar way to ``'w'``. Add a
+ ``'+'`` to the mode to allow simultaneous reading and writing.
The :meth:`read` (when called with a positive argument), :meth:`readinto`
and :meth:`write` methods on this class will only make one system call.