관리-도구
편집 파일: xmlrpc.cpython-38.pyc
U &?�f. � @ s� d Z ddlZddlZddlZddlmZmZ ddl m Z ddlmZ ddl mZ erpddlmZmZ ddlmZ e�e�ZG d d � d ejj�ZdS )z#xmlrpclib.Transport implementation � N)� TYPE_CHECKING�Tuple)�NetworkConnectionError)� PipSession)�raise_for_status)� _HostType� _Marshallable)�SizedBufferc sJ e Zd ZdZd eeedd�� fdd� Zddedeed d �dd�Z � Z S )�PipXmlrpcTransportzRProvide a `xmlrpclib.Transport` implementation via a `PipSession` object. FN)� index_url�session�use_datetime�returnc s* t � �|� tj�|�}|j| _|| _d S )N)�super�__init__�urllib�parse�urlparse�scheme�_scheme�_session)�selfr r r Zindex_parts�� __class__� �J/opt/hc_python/lib/python3.8/site-packages/pip/_internal/network/xmlrpc.pyr s zPipXmlrpcTransport.__init__r r )r .)�host�handler�request_body�verboser c C s� t |t�st�| j||d d d f}tj�|�}z8ddi}| jj|||dd�}t |� || _ | �|j�W S t k r� } z"| js�t�t�d| jj|� � W 5 d } ~ X Y nX d S )NzContent-Typeztext/xmlT)�data�headers�streamzHTTP error %s while getting %s)� isinstance�str�AssertionErrorr r r � urlunparser �postr r �parse_response�rawr �response�logger�critical�status_code) r r r r r �parts�urlr! r* �excr r r �request"