HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/subprocess.cpython-39.pyc
a

?�f�&�	@s�ddlmZddlZddlZddlZddlmZddlmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZmZdd	lmZer�dd
lmZmZmZmZmZmZmZmZeeeefZ dZ!dd
�Z"dd�Z#dd�Z$dd�Z%ddd�Z&dd�Z'dS)�)�absolute_importN)�shlex_quote)�SpinnerInterface�open_spinner)�InstallationError)�console_to_str�str_to_display)�subprocess_logger)�
HiddenText�path_to_display)�MYPY_CHECK_RUNNING)�Any�Callable�Iterable�List�Mapping�Optional�Text�Unionz(----------------------------------------cGs2g}|D]$}t|t�r"|�|�q|�|�q|S)z&
    Create a CommandArgs object.
    )�
isinstance�list�extend�append)�argsZcommand_args�arg�r�B/usr/lib/python3.9/site-packages/pip/_internal/utils/subprocess.py�make_commands
rcCsd�dd�|D��S)z/
    Format command arguments for display.
    � css,|]$}t|t�rtt|��nt|�VqdS)N)rr
r�str��.0rrrr�	<genexpr>7s�z&format_command_args.<locals>.<genexpr>)�join�rrrr�format_command_args-s

�r%cCsdd�|D�S)z=
    Return the arguments in their raw, unredacted form.
    cSs g|]}t|t�r|jn|�qSr)rr
Zsecretr rrr�
<listcomp>Bsz'reveal_command_args.<locals>.<listcomp>rr$rrr�reveal_command_args=s�r'c	CsDt|�}t|dd�}t|�}d�|�}dj|||t|�|td�}|S)z�
    Create and return the error message to use to log a subprocess error
    with command output.

    :param lines: A list of lines, each ending with a newline.
    z
command bytes)Zdesc�z�Command errored out with exit status {exit_status}:
 command: {command_display}
     cwd: {cwd_display}
Complete output ({line_count} lines):
{output}{divider})�exit_status�command_display�cwd_displayZ
line_count�outputZdivider)r%rrr#�format�len�LOG_DIVIDER)	�cmd_args�cwd�linesr)Zcommandr*r+r,�msgrrr�make_subprocess_output_errorGs

�	�r4F�raiseTc

Csp|durg}|durg}|r*tj}
tj}ntj}
tj}t��|k}|oN|du}
|dur`t|�}|
d|�tj	�
�}|r�|�|�|D]}|�|d�q�zBt
jt|�t
jt
jt
j||d�}|js�J�|js�J�|j��Wn:t�y}z |	r�t�d||��WYd}~n
d}~00g}t|j���}|�s2�ql|��}|�|d�|
|�|
�r|�s`J�|���qz|��W|j�r�|j��n|j�r�|j��0|j�o�|j|v}|
�r�|�s�J�|�r�|�d�n
|�d�|�rf|dk�r.|�s|	�rt||||jd	�}t� |�d
�!|j|�}t"|��n8|dk�rLt�#d||j|�n|d
k�rXnt$d�!|���d�%|�S)a�
    Args:
      show_stdout: if true, use INFO to log the subprocess's stderr and
        stdout streams.  Otherwise, use DEBUG.  Defaults to False.
      extra_ok_returncodes: an iterable of integer return codes that are
        acceptable, in addition to 0. Defaults to None, which means [].
      unset_environ: an iterable of environment variable names to unset
        prior to calling subprocess.Popen().
      log_failed_cmd: if false, failed commands are not logged, only raised.
    NzRunning command %s)�stderr�stdin�stdoutr1�envz#Error %s while executing command %s�
�errorZdoner5)r0r1r2r)zSCommand errored out with exit status {}: {} Check the logs for full command output.�warnz$Command "%s" had error code %s in %s�ignorez!Invalid value: on_returncode={!r}r()&r	�info�logging�INFO�debug�DEBUGZgetEffectiveLevelr%�os�environ�copy�update�pop�
subprocess�Popenr'ZSTDOUT�PIPEr7r8�close�	ExceptionZcriticalr�readline�rstriprZspin�wait�
returncodeZfinishr4r;r-rZwarning�
ValueErrorr#)�cmdZshow_stdoutr1Z
on_returncodeZextra_ok_returncodesZcommand_desc�
extra_environZ
unset_environ�spinnerZlog_failed_cmdZlog_subprocessZ
used_levelZshowing_subprocessZuse_spinnerr9�name�proc�excZ
all_output�lineZproc_had_errorr3Zexc_msgrrr�call_subprocessqs�


�

�

��


�
��

�
�rYcsd�fdd�	}|S)z�Provide a subprocess_runner that shows a spinner message.

    Intended for use with for pep517's Pep517HookCaller. Thus, the runner has
    an API that matches what's expected by Pep517HookCaller.subprocess_runner.
    Ncs<t��� }t||||d�Wd�n1s.0YdS)N)r1rSrT)rrY)rRr1rSrT��messagerr�runner
s
�z+runner_with_spinner_message.<locals>.runner)NNr)r[r\rrZr�runner_with_spinner_messages
�r])	FNr5NNNNNT)(Z
__future__rr?rCrHZpip._vendor.six.movesrZpip._internal.cli.spinnersrrZpip._internal.exceptionsrZpip._internal.utils.compatrrZpip._internal.utils.loggingr	Zpip._internal.utils.miscr
rZpip._internal.utils.typingr�typingr
rrrrrrrrZCommandArgsr/rr%r'r4rYr]rrrr�<module>s<(
,�