MCPcopy
hub / github.com/pex-tool/pex / open_zip

Function open_zip

pex/common.py:501–517  ·  view source on GitHub ↗

A contextmanager for zip files. Passes through positional and kwargs to zipfile.ZipFile.

(
    path,  # type: Text
    *args,  # type: Any
    **kwargs  # type: Any
)

Source from the content-addressed store, hash-verified

499
500@contextlib.contextmanager
501def open_zip(
502 path, # type: Text
503 *args, # type: Any
504 **kwargs # type: Any
505):
506 # type: (...) -> Iterator[ZipFileEx]
507 """A contextmanager for zip files.
508
509 Passes through positional and kwargs to zipfile.ZipFile.
510 """
511
512 # allowZip64=True is the default in Python 3.4+ but not in 2.7. We uniformly enable Zip64
513 # extensions across all Pex supported Pythons.
514 kwargs.setdefault("allowZip64", True)
515
516 with contextlib.closing(ZipFileEx(path, *args, **kwargs)) as zip_fp:
517 yield zip_fp
518
519
520def deterministic_walk(*args, **kwargs):

Callers 15

findMethod · 0.90
_maybe_extractMethod · 0.90
from_pexMethod · 0.90
extract_bootstrapMethod · 0.90
extract_distMethod · 0.90
prepareMethod · 0.90
create_whlFunction · 0.90
install_wheelFunction · 0.90
_read_from_zipFunction · 0.90
find_wheel_metadataFunction · 0.90
find_zip_sdist_metadataFunction · 0.90
zip_hashFunction · 0.90

Calls 1

ZipFileExClass · 0.85