Current Path: > > opt > hc_python > > > lib > python3.12 > site-packages > virtualenv > > util >
Operation : Linux host59.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 Software : Apache Server IP : 198.54.126.42 | Your IP: 216.73.216.8 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
__pycache__ | Directory | - | - | |
path | Directory | - | - | |
subprocess | Directory | - | - | |
__init__.py | File | 0 bytes | April 04 2025 08:09:07. | |
error.py | File | 323 bytes | April 04 2025 08:09:07. | |
lock.py | File | 4786 bytes | April 04 2025 08:09:07. | |
zipapp.py | File | 1232 bytes | April 04 2025 08:09:07. |
from __future__ import annotations import logging import os import zipfile from virtualenv.info import IS_WIN, ROOT LOGGER = logging.getLogger(__name__) def read(full_path): sub_file = _get_path_within_zip(full_path) with zipfile.ZipFile(ROOT, "r") as zip_file, zip_file.open(sub_file) as file_handler: return file_handler.read().decode("utf-8") def extract(full_path, dest): LOGGER.debug("extract %s to %s", full_path, dest) sub_file = _get_path_within_zip(full_path) with zipfile.ZipFile(ROOT, "r") as zip_file: info = zip_file.getinfo(sub_file) info.filename = dest.name zip_file.extract(info, str(dest.parent)) def _get_path_within_zip(full_path): full_path = os.path.realpath(os.path.abspath(str(full_path))) prefix = f"{ROOT}{os.sep}" if not full_path.startswith(prefix): msg = f"full_path={full_path} should start with prefix={prefix}." raise RuntimeError(msg) sub_file = full_path[len(prefix) :] if IS_WIN: # paths are always UNIX separators, even on Windows, though __file__ still follows platform default sub_file = sub_file.replace(os.sep, "/") return sub_file __all__ = [ "extract", "read", ]
SILENT KILLER Tool