403Webshell
Server IP : 172.67.216.182  /  Your IP : 162.158.88.21
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/click/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/click/_unicodefun.py
import codecs
import os
from gettext import gettext as _


def _verify_python_env() -> None:
    """Ensures that the environment is good for Unicode."""
    try:
        from locale import getpreferredencoding

        fs_enc = codecs.lookup(getpreferredencoding()).name
    except Exception:
        fs_enc = "ascii"

    if fs_enc != "ascii":
        return

    extra = [
        _(
            "Click will abort further execution because Python was"
            " configured to use ASCII as encoding for the environment."
            " Consult https://click.palletsprojects.com/unicode-support/"
            " for mitigation steps."
        )
    ]

    if os.name == "posix":
        import subprocess

        try:
            rv = subprocess.Popen(
                ["locale", "-a"],
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
                encoding="ascii",
                errors="replace",
            ).communicate()[0]
        except OSError:
            rv = ""

        good_locales = set()
        has_c_utf8 = False

        for line in rv.splitlines():
            locale = line.strip()

            if locale.lower().endswith((".utf-8", ".utf8")):
                good_locales.add(locale)

                if locale.lower() in ("c.utf8", "c.utf-8"):
                    has_c_utf8 = True

        if not good_locales:
            extra.append(
                _(
                    "Additional information: on this system no suitable"
                    " UTF-8 locales were discovered. This most likely"
                    " requires resolving by reconfiguring the locale"
                    " system."
                )
            )
        elif has_c_utf8:
            extra.append(
                _(
                    "This system supports the C.UTF-8 locale which is"
                    " recommended. You might be able to resolve your"
                    " issue by exporting the following environment"
                    " variables:"
                )
            )
            extra.append("    export LC_ALL=C.UTF-8\n    export LANG=C.UTF-8")
        else:
            extra.append(
                _(
                    "This system lists some UTF-8 supporting locales"
                    " that you can pick from. The following suitable"
                    " locales were discovered: {locales}"
                ).format(locales=", ".join(sorted(good_locales)))
            )

        bad_locale = None

        for env_locale in os.environ.get("LC_ALL"), os.environ.get("LANG"):
            if env_locale and env_locale.lower().endswith((".utf-8", ".utf8")):
                bad_locale = env_locale

            if env_locale is not None:
                break

        if bad_locale is not None:
            extra.append(
                _(
                    "Click discovered that you exported a UTF-8 locale"
                    " but the locale system could not pick up from it"
                    " because it does not exist. The exported locale is"
                    " {locale!r} but it is not supported."
                ).format(locale=bad_locale)
            )

    raise RuntimeError("\n\n".join(extra))

Youez - 2016 - github.com/yon3zu
LinuXploit