MCPcopy Create free account
hub / github.com/numpy/numpy / zipfile_factory

Function zipfile_factory

numpy/lib/npyio.py:91–103  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

89
90
91def 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
106class NpzFile(Mapping):

Callers 2

__init__Method · 0.85
_savezFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected