관리-도구
편집 파일: utils.cpython-37.pyc
B ��Re�u � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlm Z ddlmZ ddlmZ ddlmZ ddlmZ dd lmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z# dd l$m%Z% ddl&m'Z' ddl(m)Z)m*Z*m+Z+m,Z, d Z-e�.� Z/ddd�Z0ej1dk�r:dd� Z2dd� Zdd� Z3dd� Z4didd�Z5dd� Z6dd � Z7d!d"� Z8d#d$� Z9d%d&� Z:d'd(� Z;djd)d*�Z<d+d,� Z=d-d.� Z>d/d0� Z?d1d2� Z@d3d4� ZAd5d6� ZBd7d8� ZCd9d:� ZDeEd;�ZFd<d=� ZGd>d?� ZHd@dA� ZIdBdC� ZJdDdE� ZKdFdG� ZLejMdHdI� �ZNdJdK� ZOdkdLdM�ZPdNdO� ZQdldQdR�ZRdSdT� ZSdUdV� ZTdW�UdX�ZVeVdY ZWeVdZ ZXd[d\� ZYd]d^� ZZd_d`� Z[e�\da�Z]e�\db�Z^dcdd� Z_dedf� Z`dgdh� ZadS )mz� requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. � N)�OrderedDict� )�__version__)�certs)�to_native_string)�parse_http_list)�quote�urlparse�bytes�str�unquote� getproxies�proxy_bypass� urlunparse� basestring� integer_types�is_py3�proxy_bypass_environment�getproxies_environment�Mapping)�cookiejar_from_dict)�CaseInsensitiveDict)� InvalidURL� InvalidHeader�FileModeWarning�UnrewindableBodyError)z.netrc�_netrc�P i� )�http�https�win32c C s� yt rdd l}ndd l}W n tk r. dS X y6|�|jd�}t|�|d�d �}|�|d�d }W n tk rz dS X |r�|s�dS |� d�}xX|D ]P}|dkr�d| kr�d S |� dd �}|� dd�}|� d d�}t�|| tj �r�d S q�W dS )Nr Fz;Software\Microsoft\Windows\CurrentVersion\Internet SettingsZProxyEnableZ ProxyOverride�;z<local>�.Tz\.�*z.*�?)r �winreg�_winreg�ImportError�OpenKey�HKEY_CURRENT_USER�int�QueryValueEx�OSError�split�replace�re�match�I)�hostr% ZinternetSettingsZproxyEnableZ proxyOverride�test� r4 ��/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_vendor/requests/utils.py�proxy_bypass_registry0 s8 r6 c C s t � rt| �S t| �S dS )z�Return True, if the host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. N)r r r6 )r2 r4 r4 r5 r W s r c C s t | d�r| �� } | S )z/Returns an internal sequence dictionary update.�items)�hasattrr7 )�dr4 r4 r5 �dict_to_sequencec s r: c C s4 d }d}t | d�rt| �}nbt | d�r.| j}nPt | d�r~y| �� }W n tjk rZ Y n$X t�|�j}d| jkr~t � dt� t | d��ry| �� }W n$ t tfk r� |d k r�|}Y n^X t | d��r|d k�ry&| �dd � | �� }| �|p�d� W n t tfk �r d}Y nX |d k�r&d}td|| �S ) Nr �__len__�len�fileno�ba% Requests has determined the content-length for this request using the binary size of the file: however, the file has been opened in text mode (i.e. without the 'b' flag in the mode). This may lead to an incorrect content-length. In Requests 3.0, support will be removed for files in text mode.�tell�seek� )r8 r<