REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.46 KB
Close
/opt/alt/python39/lib64/python3.9/importlib/_common.py
Text
Base64
import os import pathlib import zipfile import tempfile import functools import contextlib def from_package(package): """ Return a Traversable object for the given package. """ return fallback_resources(package.__spec__) def fallback_resources(spec): package_directory = pathlib.Path(spec.origin).parent try: archive_path = spec.loader.archive rel_path = package_directory.relative_to(archive_path) return zipfile.Path(archive_path, str(rel_path) + '/') except Exception: pass return package_directory @contextlib.contextmanager def _tempfile(reader, suffix=''): # Not using tempfile.NamedTemporaryFile as it leads to deeper 'try' # blocks due to the need to close the temporary file to work on Windows # properly. fd, raw_path = tempfile.mkstemp(suffix=suffix) try: os.write(fd, reader()) os.close(fd) yield pathlib.Path(raw_path) finally: try: os.remove(raw_path) except FileNotFoundError: pass @functools.singledispatch @contextlib.contextmanager def as_file(path): """ Given a Traversable object, return that object as a path on the local file system in a context manager. """ with _tempfile(path.read_bytes, suffix=path.name) as local: yield local @as_file.register(pathlib.Path) @contextlib.contextmanager def _(path): """ Degenerate behavior for pathlib.Path objects. """ yield path
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2025-07-22 07:03:57
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
abc.py
14.57 KB
lrw-r--r--
2025-06-03 18:47:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
machinery.py
844 B
lrw-r--r--
2025-06-03 18:47:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
metadata.py
18.31 KB
lrw-r--r--
2025-06-03 18:47:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
resources.py
7.04 KB
lrw-r--r--
2025-06-03 18:47:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
util.py
11.06 KB
lrw-r--r--
2025-06-03 18:47:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_bootstrap.py
39.38 KB
lrw-r--r--
2025-06-03 18:47:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_bootstrap_external.py
63.42 KB
lrw-r--r--
2025-06-03 18:47:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_common.py
1.46 KB
lrw-r--r--
2025-06-03 18:47:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
5.92 KB
lrw-r--r--
2025-06-03 18:47:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).