| OLD | NEW |
| 1 :mod:`zipfile` --- Work with ZIP archives | 1 :mod:`zipfile` --- Work with ZIP archives |
| 2 ========================================= | 2 ========================================= |
| 3 | 3 |
| 4 .. module:: zipfile | 4 .. module:: zipfile |
| 5 :synopsis: Read and write ZIP-format archive files. | 5 :synopsis: Read and write ZIP-format archive files. |
| 6 .. moduleauthor:: James C. Ahlstrom <jim@interet.com> | 6 .. moduleauthor:: James C. Ahlstrom <jim@interet.com> |
| 7 .. sectionauthor:: James C. Ahlstrom <jim@interet.com> | 7 .. sectionauthor:: James C. Ahlstrom <jim@interet.com> |
| 8 | 8 |
| 9 **Source code:** :source:`Lib/zipfile.py` | 9 **Source code:** :source:`Lib/zipfile.py` |
| 10 | 10 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 Set *pwd* as default password to extract encrypted files. | 238 Set *pwd* as default password to extract encrypted files. |
| 239 | 239 |
| 240 | 240 |
| 241 .. method:: ZipFile.read(name, pwd=None) | 241 .. method:: ZipFile.read(name, pwd=None) |
| 242 | 242 |
| 243 Return the bytes of the file *name* in the archive. *name* is the name of th
e | 243 Return the bytes of the file *name* in the archive. *name* is the name of th
e |
| 244 file in the archive, or a :class:`ZipInfo` object. The archive must be open
for | 244 file in the archive, or a :class:`ZipInfo` object. The archive must be open
for |
| 245 read or append. *pwd* is the password used for encrypted files and, if speci
fied, | 245 read or append. *pwd* is the password used for encrypted files and, if speci
fied, |
| 246 it will override the default password set with :meth:`setpassword`. Calling | 246 it will override the default password set with :meth:`setpassword`. Calling |
| 247 :meth:`read` on a closed ZipFile will raise a :exc:`RuntimeError`. | 247 :meth:`read` on a closed ZipFile will raise a :exc:`RuntimeError`. |
| 248 |
| 249 |
| 250 .. method:: ZipFile.remove(member) |
| 251 |
| 252 Removes the file *member* from the archive. *member* must be the full file |
| 253 name in the archive or a :class:`ZipInfo` object. The archive must be open i
n |
| 254 append mode. Calling :meth:`remove` on a closed ZipFile will raise a |
| 255 :exc:`RuntimeError`. |
| 256 |
| 257 .. versionadded:: 3.3 |
| 248 | 258 |
| 249 | 259 |
| 250 .. method:: ZipFile.testzip() | 260 .. method:: ZipFile.testzip() |
| 251 | 261 |
| 252 Read all the files in the archive and check their CRC's and file headers. | 262 Read all the files in the archive and check their CRC's and file headers. |
| 253 Return the name of the first bad file, or else return ``None``. Calling | 263 Return the name of the first bad file, or else return ``None``. Calling |
| 254 :meth:`testzip` on a closed ZipFile will raise a :exc:`RuntimeError`. | 264 :meth:`testzip` on a closed ZipFile will raise a :exc:`RuntimeError`. |
| 255 | 265 |
| 256 | 266 |
| 257 .. method:: ZipFile.write(filename, arcname=None, compress_type=None) | 267 .. method:: ZipFile.write(filename, arcname=None, compress_type=None) |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 490 |
| 481 .. attribute:: ZipInfo.compress_size | 491 .. attribute:: ZipInfo.compress_size |
| 482 | 492 |
| 483 Size of the compressed data. | 493 Size of the compressed data. |
| 484 | 494 |
| 485 | 495 |
| 486 .. attribute:: ZipInfo.file_size | 496 .. attribute:: ZipInfo.file_size |
| 487 | 497 |
| 488 Size of the uncompressed file. | 498 Size of the uncompressed file. |
| 489 | 499 |
| OLD | NEW |