Create a ZipFile. Allows for Zip64, and the `file` argument can accept file, str, or pathlib.Path objects. `args` and `kwargs` are passed to the zipfile.ZipFile constructor.
(file, *args, **kwargs)
| 89 | |
| 90 | |
| 91 | def zipfile_factory(file, *args, **kwargs): |
| 92 | """ |
| 93 | Create a ZipFile. |
| 94 | |
| 95 | Allows for Zip64, and the `file` argument can accept file, str, or |
| 96 | pathlib.Path objects. `args` and `kwargs` are passed to the zipfile.ZipFile |
| 97 | constructor. |
| 98 | """ |
| 99 | if not hasattr(file, 'read'): |
| 100 | file = os_fspath(file) |
| 101 | import zipfile |
| 102 | kwargs['allowZip64'] = True |
| 103 | return zipfile.ZipFile(file, *args, **kwargs) |
| 104 | |
| 105 | |
| 106 | class NpzFile(Mapping): |