PHP 8.2.30
Preview: main.py Size: 1.33 KB
/proc/thread-self/root/proc/thread-self/root/usr/lib/python3.8/site-packages/pip/_internal/main.py

"""Primary application entrypoint.
"""
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False

from __future__ import absolute_import

import locale
import logging
import os
import sys

from pip._internal.cli.autocompletion import autocomplete
from pip._internal.cli.main_parser import parse_command
from pip._internal.commands import create_command
from pip._internal.exceptions import PipError
from pip._internal.utils import deprecation

logger = logging.getLogger(__name__)


def main(args=None):
    if args is None:
        args = sys.argv[1:]

    # Configure our deprecation warnings to be sent through loggers
    deprecation.install_warning_logger()

    autocomplete()

    try:
        cmd_name, cmd_args = parse_command(args)
    except PipError as exc:
        sys.stderr.write("ERROR: %s" % exc)
        sys.stderr.write(os.linesep)
        sys.exit(1)

    # Needed for locale.getpreferredencoding(False) to work
    # in pip._internal.utils.encoding.auto_decode
    try:
        locale.setlocale(locale.LC_ALL, '')
    except locale.Error as e:
        # setlocale can apparently crash if locale are uninitialized
        logger.debug("Ignoring error %s when setting locale", e)
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))

    return command.main(cmd_args)

Directory Contents

Dirs: 10 × Files: 15

Name Size Perms Modified Actions
cli DIR
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
commands DIR
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
models DIR
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
network DIR
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
req DIR
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
utils DIR
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
vcs DIR
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
7.34 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
8.17 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
17.58 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
13.88 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
20.32 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
10.01 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
36.02 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
16.83 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
5.29 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
1.33 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
15.57 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
6.34 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
7.75 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
42.07 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
80 B lrw-r--r-- 2023-10-17 18:30:24
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).