diff options
author | Fred Drake <fdrake@acm.org> | 2001-05-09 19:57:37 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-05-09 19:57:37 (GMT) |
commit | bda3a59a9324c134adaa221027589cf90f957d58 (patch) | |
tree | 9e29d7007e01185da32d0b0eafd130654e465f0d /Doc | |
parent | fd16834ca7eec00fbdbfccbd551d335f2cbd5d3d (diff) | |
download | cpython-bda3a59a9324c134adaa221027589cf90f957d58.zip cpython-bda3a59a9324c134adaa221027589cf90f957d58.tar.gz cpython-bda3a59a9324c134adaa221027589cf90f957d58.tar.bz2 |
Itamar Shtull-Trauring <python@itamarst.org>:
Updates zipfile.ZipFile docs to mention the fact that you can create a
ZipFile instance from an arbitrary file-like object.
This closes patch #418011.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libzipfile.tex | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/lib/libzipfile.tex b/Doc/lib/libzipfile.tex index 2f2f562..8225cfb 100644 --- a/Doc/lib/libzipfile.tex +++ b/Doc/lib/libzipfile.tex @@ -77,13 +77,14 @@ The available attributes of this module are: \subsection{ZipFile Objects \label{zipfile-objects}} -\begin{classdesc}{ZipFile}{filename\optional{, mode\optional{, compression}}} - Open a ZIP file named \var{filename}. The \var{mode} parameter +\begin{classdesc}{ZipFile}{file\optional{, mode\optional{, compression}}} + Open a ZIP file, where \var{file} can be either a path to a file + (i.e. a string) or a file-like object. The \var{mode} parameter should be \code{'r'} to read an existing file, \code{'w'} to truncate and write a new file, or \code{'a'} to append to an - existing file. For \var{mode} is \code{'a'} and \var{filename} + existing file. For \var{mode} is \code{'a'} and \var{file} refers to an existing ZIP file, then additional files are added to - it. If \var{filename} does not refer to a ZIP file, then a new ZIP + it. If \var{file} does not refer to a ZIP file, then a new ZIP archive is appended to the file. This is meant for adding a ZIP archive to another file, such as \file{python.exe}. Using |