def METHOD_NAME(path: Path) -> ZipFile:
    buf = BytesIO()
    with ZipFile(buf, "w", allowZip64=True) as z:
        for dirpath, _, filenames in os.walk(path):
            for filename in filenames:
                file_path = os.path.join(path, dirpath, filename)
                # Zip files must always have / as path separator
                archive_path = os.path.relpath(file_path, path).replace(
                    os.pathsep, "/"
                )
                z.write(file_path, archive_path)
    return stack.enter_context(ZipFile(buf, "r", allowZip64=True))