관리-도구
편집 파일: utils.cpython-311.pyc
� R�Dg�z � � � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlm Z ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% ddl&m'Z' ddl(m)Z) dd l*m+Z+m,Z,m-Z-m.Z. dZ/ ej0 � � Z1ddd�Z2d�3 ej4 d ed�� � d � � � � Z5ej6 dk rd� Z7d� Zd� Z8d� Z9dId�Z:d� Z;d� Z<ej= d � � � Z>d!� Z?d"� Z@d#� ZAd$� ZBdId%�ZCd&� ZDd'� ZEd(� ZFd)� ZGd*� ZHd+� ZId,� ZJd-� ZK eLd.� � ZMd/� ZNd0� ZOd1� ZPd2� ZQd3� ZRd4� ZSej= d5� � � ZTd6� ZUdJd7�ZVd8� ZWdKd:�ZXd;� ZYd<� ZZd=�[ d>� � Z\e\d?z Z]e\d@z Z^dA� Z_dB� Z`dC� Za ejb dD� � Zc ejb dE� � ZddF� ZedG� ZfdH� ZgdS )Lz� requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. � N)�OrderedDict)�make_headers� ��__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�httpsz, z,\s*T)�accept_encodingzaccept-encoding�win32c �V � t rdd l}ndd l}n# t $ r Y dS w xY w |� |j d� � }t |� |d� � d � � }|� |d� � d }n# t $ r Y dS w xY w|r|sdS |� d� � }|D ]t}|dk rd| vr d S |� dd � � }|� dd� � }|� d d� � }t j || t j � � r d S �udS )Nr Fz;Software\Microsoft\Windows\CurrentVersion\Internet Settings�ProxyEnable� ProxyOverride�;z<local>�.Tz\.�*z.*�?)r �winreg�_winreg�ImportError�OpenKey�HKEY_CURRENT_USER�int�QueryValueEx�OSError�split�replace�re�match�I)�hostr- �internetSettings�proxyEnable� proxyOverride�tests �n/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/requests/utils.py�proxy_bypass_registryr@ 6 s� � � �� )�� � � � �(�(�(�(���� � � ��5�5� ���� �%�~�~�f�.F�N� P� P�� �f�1�1�2B�.;�=� =�=>�@� A� A�K� #�/�/�0@�0?�A� A�AB�D�M�M��� � � ��5�5� ����� �-� ��5� &�+�+�C�0�0� �!� � �D��y� � ��d�?�?��4�4��<�<��U�+�+�D��<�<��U�+�+�D��<�<��T�*�*�D��x��d�B�D�)�)� ��t�t� ��us � � !�!�A B � B�Bc �Z � t � � rt | � � S t | � � S )z�Return True, if the host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. )r r r@ )r: s r? r r ] s. � � "�#�#� /�+�D�1�1�1�(��.�.�.� c �N � t | d� � r| � � � } | S )z/Returns an internal sequence dictionary update.�items)�hasattrrD )�ds r? �dict_to_sequencerG i s( � � �q�'��� � �G�G�I�I���HrB c �� � d }d}t | d� � rt | � � }n�t | d� � r| j }nwt | d� � rg | � � � }t j |� � j }d| j vrt j dt � � n# t j $ r Y nw xY wt | d� � r� | � � � }t | d� � r^|�\ | � dd � � | � � � }| � |pd� � n5# t t f$ r d}Y n w xY wn# t t f$ r |�|}Y nw xY w|�d}t! d||z � � 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� )rE rJ rK �os�fstat�st_size�mode�warnings�warnr �io�UnsupportedOperationrM rN r4 �IOError�max)�o�total_length�current_positionrK s r? � super_lenr] r s� � ��L����q�)��� ��1�v�v��� ��E� � � ��u��� ��H� � � � ��X�X�Z�Z�F� �8�F�+�+�3�L� �!�&� � �� �.� $�� � ��� �&� � � ��D� ����$ �q�&��� %� %� �v�v�x�x�� �q�&�!�!� %�l�&:� %��F�F�1�a�L�L�L�#$�6�6�8�8�L� �F�F�+�0�q�1�1�1�1����)� %� %� %�#$�L�L�L�%������% ��!� 0� 0� 0� �'�#/� ��� 0����* �����q�,�!1�1�2�2�2s7 �B �B1�0B1�E �,AD. �.E�E�E �E Fc �� � t j � d� � }|�|f}nd� t D � � } ddlm}m} d}|D ]X} t j � |� � }n# t $ r Y dS w xY wt j � |� � r|} n�Y|�dS t | � � } d} t | t � � r| � d� � } | j � | � � d } ||� � � |� � }|r|d rdnd} || |d fS dS # |t"