MCPcopy Index your code
hub / github.com/numpy/numpy / zipfile_factory

Function zipfile_factory

numpy/lib/_npyio_impl.py:100–112  ·  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

98
99
100def 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')

Callers 2

__init__Method · 0.85
_savezFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…