mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
merge from 3.5
minor clarification on Zipfile 'x' mode - exclusive creation of a file. (Based on the feedback from docs@python.org list)
This commit is contained in:
commit
cbde4a6924
1 changed files with 2 additions and 2 deletions
|
@ -134,8 +134,8 @@ ZipFile Objects
|
||||||
|
|
||||||
Open a ZIP file, where *file* can be either a path to a file (a string) or a
|
Open a ZIP file, where *file* can be either a path to a file (a string) or a
|
||||||
file-like object. The *mode* parameter should be ``'r'`` to read an existing
|
file-like object. The *mode* parameter should be ``'r'`` to read an existing
|
||||||
file, ``'w'`` to truncate and write a new file, ``'x'`` to exclusive create
|
file, ``'w'`` to truncate and write a new file, ``'a'`` to append to an
|
||||||
and write a new file, or ``'a'`` to append to an existing file.
|
existing file, or ``'x'`` to exclusively create and write a new file.
|
||||||
If *mode* is ``'x'`` and *file* refers to an existing file,
|
If *mode* is ``'x'`` and *file* refers to an existing file,
|
||||||
a :exc:`FileExistsError` will be raised.
|
a :exc:`FileExistsError` will be raised.
|
||||||
If *mode* is ``'a'`` and *file* refers to an existing ZIP
|
If *mode* is ``'a'`` and *file* refers to an existing ZIP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue