HEX
Server: nginx/1.24.0
System: Linux webserver 6.8.0-87-generic #88-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 09:28:41 UTC 2025 x86_64
User: wpuser (1002)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/pip/_internal/utils/__pycache__/subprocess.cpython-312.pyc
�

��h�#����ddlZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZddl
mZddlmZmZddlmZddlmZmZddlmZerddlmZe	eeefZd	eeeefd
efd�Zd	ee	eefd
efd�Zd	ee	eefd
e	efd
�Z									ddee	eefdedeedddeee dee
eefdeeedeedeedeeded
efd�Z!ded
edfd�Z"y)�N)�
TYPE_CHECKING�Any�Callable�Iterable�List�Mapping�Optional�Union)�escape)�SpinnerInterface�open_spinner)�InstallationSubprocessError)�VERBOSE�subprocess_logger)�
HiddenText)�Literal�args�returnc�~�g}|D]5}t|t�r|j|��%|j|��7|S)z&
    Create a CommandArgs object.
    )�
isinstance�list�extend�append)r�command_args�args   �@/usr/lib/python3/dist-packages/pip/_internal/utils/subprocess.py�make_commandr sJ��!#�L��%���c�4� �����$�
����$�%���c�2�djd�|D��S)z/
    Format command arguments for display.
    � c3�K�|]G}t|t�rtjt	|��ntj|����Iy�w)N)rr�shlex�quote�str)�.0rs  r�	<genexpr>z&format_command_args.<locals>.<genexpr>:s<������",�C��!<����C��H��%�+�+�c�BR�R��s�A
A)�join)rs r�format_command_argsr(1s"���8�8�����rc�d�|D�cgc] }t|t�r|jn|��"c}Scc}w)z=
    Return the arguments in their raw, unredacted form.
    )rr�secret)rrs  r�reveal_command_argsr+@s,��KO�O�3�*�S�*�5�C�J�J�3�>�O�O��Os�%-�cmd�show_stdout�cwd�
on_returncodez"Literal["raise", "warn", "ignore"]�extra_ok_returncodes�
extra_environ�
unset_environ�spinner�log_failed_cmd�stdout_only�command_descc
	��|�g}|�g}|r!tj}tj}ntj}t
}tj�|k}
|
xr|du}|d|
�tjj�}|r|j|�|D]}|j|d��	tjt|�tjtj|	stj ntj||d��}g}|	s�|j&sJ�|j(sJ�|j(j+�	|j&j-�}|snC|j/�}|j1|dz�||�|r|sJ�|j3��`	|j5�|j&r|j&j+�	dj7|�}nq|j9�\}}|j;�D]
}||��|j1|�|j;�D]
}||��|j1|�|}|j<xr|j<|v}|r)|sJ�|r|j?d	�n|j?d
�|r�|dk(r�tA|
|j<|
s|nd��}|rmtjBd
|ddi��tjdtEtG|��ddi��tjdtE|xsd�ddi��|�|dk(r$tjHd|
|j<|�|S|dk(r	|StKd|����|S#t"$r}|rtj$d||
��d}~wwxYw#|j&r|j&j+�wwxYw)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.
      stdout_only: if true, return only stdout, else return both. When true,
        logging of both stdout and stderr occurs when the subprocess has
        terminated, else logging occurs as subprocess output is produced.
    NzRunning command %s�backslashreplace)�stdin�stdout�stderrr.�env�errorsz#Error %s while executing command %sT�
��error�done�raise)�command_description�	exit_code�output_linesz%s�rich)�extraz*[bold magenta]full command[/]: [blue]%s[/]�markupz[bold magenta]cwd[/]: %sz	[inherit]�warnz$Command "%s" had error code %s in %s�ignorezInvalid value: on_returncode=)&r�info�logging�INFO�verboser�getEffectiveLevel�os�environ�copy�update�pop�
subprocess�Popenr+�PIPE�STDOUT�	Exception�criticalr:r9�close�readline�rstripr�spin�waitr'�communicate�
splitlines�
returncode�finishrr@rr(�warning�
ValueError)r,r-r.r/r0r1r2r3r4r5r6�log_subprocess�
used_level�showing_subprocess�use_spinnerr<�name�proc�exc�
all_output�line�output�out�err�out_line�err_line�proc_had_errorr@s                            r�call_subprocessruGs���6�#�!�����
� �.?�.D�.D���\�\�
�+�2�2���
�+�<�<�>�*�L��)�(�@�W�D�-@�K��'��6�
�*�*�/�/�
�C���
�
�=�!��������d���������$��/�/��?�?�,7�:�$�$�Z�_�_���%�	
��$�J���{�{��{��z�z��z��
�
��������,�,�.�D����;�;�=�D����d�T�k�*�
�4� ����w������	$��I�I�K��{�{����!�!�#�����$���#�#�%���S����(�	%�H��8�$�	%����#�����(�	%�H��8�$�	%����#�����_�_�T����@T�)T�N����w���N�N�7�#��N�N�6�"���G�#�/�$0��/�/�/A�Z�t��E�
�!�'�'��e�F�D�>�J�!�)�)�@��.�s�3�4�#�T�*��
"�)�)�.��3�-�+�.�#�T�*���K�
�f�
$��%�%�6������	
��M�	�h�
&���M��<�]�<M�N�O�O��M��k����&�&�5���
�
	����<�{�{����!�!�#��s%�6A!N	�3N4�		N1�N,�,N1�4)O�message).Nc
���		ddttdttdttttfddf�fd�
}|S)z�Provide a subprocess_runner that shows a spinner message.

    Intended for use with for BuildBackendHookCaller. Thus, the runner has
    an API that matches what's expected by BuildBackendHookCaller.subprocess_runner.
    Nr,r.r1rc�f��t��5}t|�|||��ddd�y#1swYyxYw)N)r6r.r1r3)r
ru)r,r.r1r3rvs    �r�runnerz+runner_with_spinner_message.<locals>.runner�s;���
�'�
"�	�g���$��+��
�	�	�	�s�'�0)NN)rr$r	rr)rvrys` r�runner_with_spinner_messagerz�sQ���"�59��
�#�Y��
�c�]�� ���S�� 1�2��
�	��Mr)	FNrBNNNNTF)#rLrPr"rU�typingrrrrrrr	r
�pip._vendor.rich.markupr�pip._internal.cli.spinnersrr
�pip._internal.exceptionsr�pip._internal.utils.loggingrr�pip._internal.utils.miscrrr$�CommandArgsrr(r+�bool�intrurz�rr�<module>r�s����	���	�	�	�+�E�@�B�/����5��j��)�*����c�:�{�:�;����"�e�D��I�{�$:�;����P�e�D��I�{�$:�;�P��S�	�P���:A�48�15�-1�*.�%)�"'�e�	�t�C�y�+�%�	&�e��e�
�#��e�8�	e�
#�8�C�=�1�e��G�C��H�-�.�
e��H�S�M�*�e��&�
'�e��T�N�e��$��e��e�	�e�P����)�1D�r