From: Fred Drake Date: Wed, 9 May 2001 19:57:50 +0000 (+0000) Subject: Itamar Shtull-Trauring : X-Git-Tag: v2.1.1c1~135 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ee94e69659c40b9dd4ba512621fbf562bef33d8;p=thirdparty%2FPython%2Fcpython.git Itamar Shtull-Trauring : 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. --- diff --git a/Doc/lib/libzipfile.tex b/Doc/lib/libzipfile.tex index 2f2f562d5737..8225cfb948d6 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