3
V'ícý ã @ sö d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZddlm
Z
ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd
lmZ ddlmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z& ddl'm(Z( dd
l)m*Z* ddl+m,Z,m-Z-m.Z.m/Z/ dvZ0ej1 Z2dddZ3dj4ej5deddd Z6ej7dkrndd Z8dd Zdd Z9d d! Z:dwd#d$Z;d%d& Z<d'd( Z=ej>d)d* Z?d+d, Z@d-d. ZAd/d0 ZBd1d2 ZCdxd3d4ZDd5d6 ZEd7d8 ZFd9d: ZGd;d< ZHd=d> ZId?d@ ZJdAdB ZKdCdD ZLeMdyZNdGdH ZOdIdJ ZPdKdL ZQdMdN ZRdOdP ZSdQdR ZTej>dSdT ZUdUdV ZVdzdWdXZWdYdZ ZXd{d[d\ZYd|d^d_ZZd`da Z[dbdc Z\ddj]deZ^e^df Z_e^dg Z`dhdi Zadjdk Zbdldm ZcejddnZeejddoZfdpdq Zgdrds Zhdtdu ZidS )}z
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
é N)ÚOrderedDict)Úmake_headers)Ú parse_urlé )Ú__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ú.netrcÚ_netrcéP i» )ÚhttpÚhttpsz, z,\s*T)Úaccept_encodingzaccept-encodingÚwin32c C sô yt rdd l}ndd l}W n tk
r. dS X y6|j|jd}t|j|dd }|j|dd }W n tk
rz dS X | s| rdS |j d}xX|D ]P}|dkr´d| kr´d S |j
dd
}|j
dd}|j
d
d}tj|| 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© r8 ú2/tmp/pip-build-gk9425m9/requests/requests/utils.pyÚproxy_bypass_registry7 s8
r: 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 r: )r6 r8 r8 r9 r ^ s r c C s t | dr| j } | S )z/Returns an internal sequence dictionary update.Úitems)Úhasattrr; )Údr8 r8 r9 Údict_to_sequencej s
r>