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)
| 98 | |
| 99 | |
| 100 | def zipfile_factory(file, *args, **kwargs): |
| 101 | """ |
| 102 | Create a ZipFile. |
| 103 | |
| 104 | Allows for Zip64, and the `file` argument can accept file, str, or |
| 105 | pathlib.Path objects. `args` and `kwargs` are passed to the zipfile.ZipFile |
| 106 | constructor. |
| 107 | """ |
| 108 | if not hasattr(file, 'read'): |
| 109 | file = os.fspath(file) |
| 110 | import zipfile |
| 111 | kwargs['allowZip64'] = True |
| 112 | return zipfile.ZipFile(file, *args, **kwargs) |
| 113 | |
| 114 | |
| 115 | @set_module('numpy.lib.npyio') |