@@ -25,10 +25,6 @@ \section{\module{zipfile} ---
2525 The error raised for bad ZIP files.
2626\end {excdesc }
2727
28- \begin {datadesc }{_debug}
29- Level of printing, defaults to \code {1}.
30- \end {datadesc }
31-
3228\begin {classdesc }{ZipFile}{\unspecified }
3329 The class for reading and writing ZIP files. See
3430 `` \citetitle {ZipFile Objects }'' (section \ref {zipfile-objects }) for
@@ -42,7 +38,7 @@ \section{\module{zipfile} ---
4238\begin {classdesc }{ZipInfo}{\optional {filename\optional {, date_time}}}
4339 Class used the represent infomation about a member of an archive.
4440 Instances of this class are returned by the \method {getinfo()} and
45- \method {listinfo ()} methods of \class {ZipFile} objects. Most users
41+ \method {infolist ()} methods of \class {ZipFile} objects. Most users
4642 of the \module {zipfile} module will not need to create these, but
4743 only use those created by this module.
4844 \var {filename} should be the full name of the archive member, and
@@ -99,10 +95,22 @@ \subsection{ZipFile Objects \label{zipfile-objects}}
9995 \var {compression} is the ZIP compression method to use when writing
10096 the archive, and should be \constant {ZIP_STORED} or
10197 \constant {ZIP_DEFLATED}; unrecognized values will cause
102- \exception {ValueError} to be raised. The default is
98+ \exception {RuntimeError} to be raised. If \constant {ZIP_DEFLATED}
99+ is specified but the \refmodule {zlib} module is not avaialble,
100+ \exception {RuntimeError} is also raised. The default is
103101 \constant {ZIP_STORED}.
104102\end {classdesc }
105103
104+ \begin {methoddesc }{close}{}
105+ Close the archive file. You must call \method {close()} before
106+ exiting your program or essential records will not be written.
107+ \end {methoddesc }
108+
109+ \begin {methoddesc }{getinfo}{name}
110+ Return a \class {ZipInfo} object with information about the archive
111+ member \var {name}.
112+ \end {methoddesc }
113+
106114\begin {methoddesc }{namelist}{}
107115 Return a list of archive members by name.
108116\end {methoddesc }
@@ -127,22 +135,21 @@ \subsection{ZipFile Objects \label{zipfile-objects}}
127135 name of the first bad file, or else return \code {None}.
128136\end {methoddesc }
129137
130- \begin {methoddesc }{writestr}{bytes, arcname, year, month, day,
131- hour, minute, second}
132- Write the string \var {bytes} and the other data to the archive, and
133- give the archive member the name \var {arcname}. The archive must be
134- opened with mode \code {'w'} or \code {'a'}.
135- \end {methoddesc }
136-
137- \begin {methoddesc }{write}{filename, arcname}
138+ \begin {methoddesc }{write}{filename\optional {, arcname\optional {,
139+ compress_type}}}
138140 Write the file named \var {filename} to the archive, giving it the
139- archive name \var {arcname}. The archive must be open with mode
140- \code {'w'} or \code {'a'}.
141+ archive name \var {arcname} (by default, this will be the same as
142+ \var {filename}). If given, \var {compress_type} overrides the value
143+ given for the \var {compression} parameter to the constructor for
144+ the new entry. The archive must be open with mode \code {'w'} or
145+ \code {'a'}.
141146\end {methoddesc }
142147
143- \begin {methoddesc }{close}{}
144- Close the archive file. You must call \method {close()} before
145- exiting your program or essential records will not be written.
148+ \begin {methoddesc }{writestr}{zinfo, bytes}
149+ Write the string \var {bytes} to the archive; meta-information is
150+ given as the \class {ZipInfo} instance \var {zinfo}. At least the
151+ filename, date, and time must be given by \var {zinfo}. The archive
152+ must be opened with mode \code {'w'} or \code {'a'}.
146153\end {methoddesc }
147154
148155
@@ -189,7 +196,7 @@ \subsection{PyZipFile Objects \label{pyzipfile-objects}}
189196\subsection {ZipInfo Objects \label {zipinfo-objects } }
190197
191198Instances of the \class {ZipInfo} class are returned by the
192- \method {getinfo()} and \method {listinfo ()} methods of
199+ \method {getinfo()} and \method {infolist ()} methods of
193200\class {ZipFile} objects. Each object stores information about a
194201single member of the ZIP archive.
195202
0 commit comments