Repository URL to install this package:
|
Version:
2.0.0-beta3-2-armbian20.08.0-trunk1 ▾
|
wiperf
/
usr
/
local
/
lib
/
python3.7
/
dist-packages
/
requests
/
__pycache__
/
utils.cpython-37.pyc
|
|---|
B
\7@b0ñã @ 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/dddZ0ej1dkr:dd Z2dd Zdd Z3dd Z4diddZ5dd 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 ZOdkdLdMZPdNdO ZQdldQdRZRdSdT 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|sdS | d¡}xX|D ]P}|dkr°d| kr°d S |
dd
¡}|
dd¡}|
d
d¡}t || tj
¡rd S qW 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 ú4/tmp/pip-install-z4i6eiy2/requests/requests/utils.pyÚproxy_bypass_registry0 s8
r6 c C s t rt| S t| S dS )zReturn 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 | dr| ¡ } | S )z/Returns an internal sequence dictionary update.Úitems)Úhasattrr7 )Údr4 r4 r5 Údict_to_sequencec s
r: c C s4 d }d}t | drt| }nbt | dr.| j}nPt | dr~y| ¡ }W n tjk
rZ Y n$X t |¡j}d| jkr~t
dt¡ t | dry| ¡ }W n$ t
tfk
rº |d k r¶|}Y n^X t | dr|d kry&| dd ¡ | ¡ }| |pòd¡ W n t
tfk
r d}Y nX |d kr&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<