Skip to content

Commit d7baea1

Browse files
author
Adi Roiban
committed
Add documentation
1 parent 63856e8 commit d7baea1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Doc/library/zipfile.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ ZipFile Objects
171171

172172
.. class:: ZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=True, \
173173
compresslevel=None, *, strict_timestamps=True, \
174-
metadata_encoding=None)
174+
metadata_encoding=None, \
175+
zipinfo_class=ZipInfo, zipextfile_class=ZipExtFile)
175176
176177
Open a ZIP file, where *file* can be a path to a file (a string), a
177178
file-like object or a :term:`path-like object`.
@@ -235,6 +236,12 @@ ZipFile Objects
235236
with ZipFile('spam.zip', 'w') as myzip:
236237
myzip.write('eggs.txt')
237238

239+
The *zipinfo_class* and *zipextfile_class* are designed to help extend the
240+
functionalities.
241+
For now, there is no stable public protocol or interface for these classes.
242+
When implementing custom classes you will need to follow the public and
243+
private API from :class:`ZipInfo` and ``ZipExtFile``.
244+
238245
.. note::
239246

240247
*metadata_encoding* is an instance-wide setting for the ZipFile.
@@ -278,6 +285,9 @@ ZipFile Objects
278285
Added support for specifying member name encoding for reading
279286
metadata in the zipfile's directory and file headers.
280287

288+
.. versionchanged:: 3.15
289+
Add the *zipinfo_class* and *zipextfile_class* parameters.
290+
281291

282292
.. method:: ZipFile.close()
283293

0 commit comments

Comments
 (0)