/usr/lib/python3.9/site-packages/requests/__pycache__
NameSizeModeActions
adapters.cpython-39.opt-1.pyc225890644editdlrm
adapters.cpython-39.pyc225890644editdlrm
api.cpython-39.opt-1.pyc67110644editdlrm
api.cpython-39.pyc67110644editdlrm
auth.cpython-39.opt-1.pyc82830644editdlrm
auth.cpython-39.pyc82830644editdlrm
certs.cpython-39.opt-1.pyc8320644editdlrm
certs.cpython-39.pyc8320644editdlrm
compat.cpython-39.opt-1.pyc16050644editdlrm
compat.cpython-39.pyc16050644editdlrm
cookies.cpython-39.opt-1.pyc187740644editdlrm
cookies.cpython-39.pyc187740644editdlrm
exceptions.cpython-39.opt-1.pyc51850644editdlrm
exceptions.cpython-39.pyc51850644editdlrm
help.cpython-39.opt-1.pyc26100644editdlrm
help.cpython-39.pyc26100644editdlrm
hooks.cpython-39.opt-1.pyc9420644editdlrm
hooks.cpython-39.pyc9420644editdlrm
models.cpython-39.opt-1.pyc238190644editdlrm
models.cpython-39.pyc238190644editdlrm
packages.cpython-39.opt-1.pyc3610644editdlrm
packages.cpython-39.pyc3610644editdlrm
sessions.cpython-39.opt-1.pyc198160644editdlrm
sessions.cpython-39.pyc198160644editdlrm
status_codes.cpython-39.opt-1.pyc41910644editdlrm
status_codes.cpython-39.pyc41910644editdlrm
structures.cpython-39.opt-1.pyc44120644editdlrm
structures.cpython-39.pyc44120644editdlrm
utils.cpython-39.opt-1.pyc237500644editdlrm
utils.cpython-39.pyc237500644editdlrm
_internal_utils.cpython-39.opt-1.pyc12280644editdlrm
_internal_utils.cpython-39.pyc12540644editdlrm
__init__.cpython-39.opt-1.pyc32890644editdlrm
__init__.cpython-39.pyc34330644editdlrm
__version__.cpython-39.opt-1.pyc5070644editdlrm
__version__.cpython-39.pyc5070644editdlrm
Edit: /usr/lib/python3.9/site-packages/requests/__pycache__/utils.cpython-39.pyc (23750B)
a ¥/�h�|ã@sÄdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddlmZddlmZddlmZddlmZdd lmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#dd l$m%Z%dd l&m'Z'dd l(m)Z)m*Z*m+Z+m,Z,d Z-e .¡Z/dddœZ0ej1dk�r:dd„Z2dd„Zdd„Z3dd„Z4dpdd„Z5dd„Z6dd „Z7d!d"„Z8d#d$„Z9d%d&„Z:d'd(„Z;dqd)d*„Zd/d0„Z?d1d2„Z@d3d4„ZAd5d6„ZBd7d8„ZCd9d:„ZDeEd;ƒZFdd?„ZHdrdAdB„ZIdCdD„ZJdEdF„ZKdGdH„ZLdIdJ„ZMdKdL„ZNdMdN„ZOejPdOdP„ƒZQdQdR„ZRdsdSdT„ZSdUdV„ZTdtdXdY„ZUdZd[„ZVd\d]„ZWd^ Xd_¡ZYeYd`ZZeYdaZ[dbdc„Z\ddde„Z]dfdg„Z^e _dh¡Z`e _di¡Zadjdk„Zbdldm„Zcdndo„ZddS)uz” 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éPi»)ÚhttpÚhttpsÚwin32cCsðztrddl}nddl}Wnty.YdS0z6| |jd¡}t| |d¡dƒ}| |d¡d}WntyzYdS0|r„|sˆdS|  d¡}|D]T}|dkr°d|vr°d S|  dd ¡}|  d d ¡}|  d d¡}t   ||t j ¡r–d Sq–dS)NrFz;Software\Microsoft\Windows\CurrentVersion\Internet SettingsZ ProxyEnableZ ProxyOverrideú;zÚ.Tz\.Ú*z.*ú?)rÚwinregZ_winregÚ ImportErrorÚOpenKeyÚHKEY_CURRENT_USERÚintZ QueryValueExÚOSErrorÚsplitÚreplaceÚreÚmatchÚI)Úhostr'ZinternetSettingsZ proxyEnableZ proxyOverrideÚtest©r4ú2/usr/lib/python3.9/site-packages/requests/utils.pyÚproxy_bypass_registry0sF   ÿÿÿÿÿ     r6cCstƒrt|ƒSt|ƒSdS)zšReturn True, if the host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. N)rrr6)r2r4r4r5rWsrcCst|dƒr| ¡}|S)z/Returns an internal sequence dictionary update.Úitems)Úhasattrr7)Údr4r4r5Údict_to_sequencecs r:c Cs.d}d}t|dƒrt|ƒ}n`t|dƒr.|j}nNt|dƒr|z | ¡}WntjyXYn$0t |¡j}d|jvr|t   dt ¡t|dƒ�rz |  ¡}Wn"t tfy¶|dur²|}Yn\0t|dƒ�r|du�rz&| dd ¡|  ¡}| |pîd¡Wnt tf�yd}Yn0|du�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é)r8r<r=ÚioÚUnsupportedOperationÚosÚfstatÚst_sizeÚmodeÚwarningsÚwarnrr?r,ÚIOErrorr@Úmax)ÚoZ total_lengthZcurrent_positionr=r4r4r5Ú super_lenlsB       ù      rMFc Cstj d¡}|dur|f}ndd„tDƒ}zÔddlm}m}d}|D]B}ztj |¡}WntypYWdS0tj  |¡rD|}qˆqD|dur–WdSt |ƒ} | j } z:||ƒ  | ¡} | rÜ| drÄdnd} | | | dfWWSWn|t fyú|rö‚Yn0Wnttf�yYn0dS) z;Returns the Requests tuple auth for a given url from netrc.ZNETRCNcss|]}d |¡VqdS)z~/{}N)Úformat)Ú.0Úfr4r4r5Ú °óz!get_netrc_auth..r)ÚnetrcÚNetrcParseErrorrrA)rDÚenvironÚgetÚ NETRC_FILESrSrTÚpathÚ expanduserÚKeyErrorÚexistsr ÚhostnameZauthenticatorsrJr(ÚAttributeError) ÚurlZ raise_errorsZ netrc_fileZnetrc_locationsrSrTZ netrc_pathrPÚlocZrir2rZlogin_ir4r4r5Úget_netrc_auth©s:     r`cCsBt|ddƒ}|r>t|tƒr>|ddkr>|ddkr>tj |¡SdS)z0Tries to guess the filename of the given object.ÚnameNrú<éÿÿÿÿú>)ÚgetattrÚ isinstancerrDrXÚbasename)Úobjrar4r4r5Úguess_filenameÜs   ÿricCs¸tj |¡r|Stj |¡\}}|rPtj |¡sPtj |¡\}}d ||g¡}q t |¡s^|St |¡}|| ¡vrx|St   ¡}tjj|g| d¡¢RŽ}tj |¡s´|j ||d�}|S)zÄReplace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged. ú/)rX) rDrXr[r-ÚjoinÚzipfileÚ is_zipfileÚZipFileZnamelistÚtempfileZ gettempdirÚextract)rXÚarchiveÚmemberÚprefixZzip_fileÚtmpZextracted_pathr4r4r5Úextract_zipped_pathsäs      rucCs.|dur dSt|ttttfƒr&tdƒ‚t|ƒS)aTake an object and test to see if it can be represented as a dictionary. Unless it can not be represented as such, return an OrderedDict, e.g., :: >>> from_key_val_list([('key', 'val')]) OrderedDict([('key', 'val')]) >>> from_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples >>> from_key_val_list({'key': 'val'}) OrderedDict([('key', 'val')]) :rtype: OrderedDict Nú+cannot encode objects that are not 2-tuples)rfr r Úboolr+Ú ValueErrorr©Úvaluer4r4r5Úfrom_key_val_lists r{cCs@|dur dSt|ttttfƒr&tdƒ‚t|tƒr8| ¡}t|ƒS)aÂTake an object and test to see if it can be represented as a dictionary. If it can be, return a list of tuples, e.g., :: >>> to_key_val_list([('key', 'val')]) [('key', 'val')] >>> to_key_val_list({'key': 'val'}) [('key', 'val')] >>> to_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples :rtype: list Nrv) rfr r rwr+rxrr7Úlistryr4r4r5Úto_key_val_lists r}cCsXg}t|ƒD]F}|dd…|dd…kr4dkrHnnt|dd…ƒ}| |¡q |S)aParse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing. It basically works like :func:`parse_set_header` just that items may appear multiple times and case sensitivity is preserved. The return value is a standard :class:`list`: >>> parse_list_header('token, "quoted value"') ['token', 'quoted value'] To create a header from the :class:`list` again, use the :func:`dump_header` function. :param value: a string with a list header. :return: :class:`list` :rtype: list Nrrcú")Ú_parse_list_headerÚunquote_header_valueÚappend)rzÚresultÚitemr4r4r5Úparse_list_header=s  ( r„cCsxi}t|ƒD]f}d|vr"d||<q | dd¡\}}|dd…|dd…krVdkrjnnt|dd…ƒ}|||<q |S)a^Parse lists of key, value pairs as described by RFC 2068 Section 2 and convert them into a python dict: >>> d = parse_dict_header('foo="is a fish", bar="as well"') >>> type(d) is dict True >>> sorted(d.items()) [('bar', 'as well'), ('foo', 'is a fish')] If there is no value for a key it will be `None`: >>> parse_dict_header('key_without_value') {'key_without_value': None} To create a header from the :class:`dict` again, use the :func:`dump_header` function. :param value: a string with a dict header. :return: :class:`dict` :rtype: dict ú=Nrrcr~)rr-r€)rzr‚rƒrar4r4r5Úparse_dict_header]s ( r†cCs\|rX|d|dkr dkrXnn4|dd…}|rD|dd…dkrX| dd¡ d d¡S|S) zçUnquotes a header value. (Reversal of :func:`quote_header_value`). This does not use the real unquoting but what browsers are actually using for quoting. :param value: the header value to unquote. :rtype: str rrcr~rNrAz\\ú\z\")r.)rzZ is_filenamer4r4r5r€€s $ r€cCsi}|D]}|j||j<q|S)z€Returns a key/value dictionary from a CookieJar. :param cj: CookieJar object to extract cookies from. :rtype: dict )rzra)ÚcjÚ cookie_dictZcookier4r4r5Údict_from_cookiejar™srŠcCs t||ƒS)zÂReturns a CookieJar from a key/value dictionary. :param cj: CookieJar to insert cookies into. :param cookie_dict: Dict of key/values to insert into CookieJar. :rtype: CookieJar r)rˆr‰r4r4r5Úadd_dict_to_cookiejar¨sr‹cCsTt dt¡tjdtjd�}tjdtjd�}t d¡}| |¡| |¡| |¡S)zlReturns encodings from given content string. :param content: bytestring to extract encodings from. z¤In requests 3.0, get_encodings_from_content will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)z!])Úflagsz+]z$^<\?xml.*?encoding=["\']*(.+?)["\'>])rHrIÚDeprecationWarningr/Úcompiler1Úfindall)ÚcontentZ charset_reZ pragma_reZxml_rer4r4r5Úget_encodings_from_content³sü ÿþr‘c Csš| d¡}|d ¡|dd…}}i}d}|D]`}| ¡}|r0|d}}| d¡} | dkr„|d| … |¡}|| dd… |¡}||| ¡<q0||fS) z¦Returns content type and parameters from given header :param header: string :return: tuple containing content type and dictionary of parameters r#rrNz"' Tr…rc)r-ÚstripÚfindÚlower) ÚheaderÚtokensÚ content_typeÚparamsZ params_dictZitems_to_stripÚparamÚkeyrzZindex_of_equalsr4r4r5Ú_parse_content_type_headerÇs   r›cCsP| d¡}|sdSt|ƒ\}}d|vr4|d d¡Sd|vr@dSd|vrLdSdS) z}Returns encodings from given HTTP Header Dict. :param headers: dictionary to extract encoding from. :rtype: str z content-typeNÚcharsetz'"Útextz ISO-8859-1zapplication/jsonúutf-8)rVr›r’)Úheadersr—r˜r4r4r5Úget_encoding_from_headersàs  r ccsj|jdur|D] }|VqdSt |j¡dd�}|D]}| |¡}|r4|Vq4|jddd�}|rf|VdS)zStream decodes a iterator.Nr.©ÚerrorsrRT)Úfinal)ÚencodingÚcodecsÚgetincrementaldecoderÚdecode)ÚiteratorÚrrƒÚdecoderÚchunkÚrvr4r4r5Ústream_decode_response_unicodeùs  r­ccsHd}|dus|dkrt|ƒ}|t|ƒkrD||||…V||7}qdS)z Iterate over slices of a string.rN)r<)ÚstringZ slice_lengthÚposr4r4r5Ú iter_slices s  r°cCszt dt¡g}t|jƒ}|rJzt|j|ƒWStyH| |¡Yn0zt|j|dd�WSt yt|jYS0dS)zâReturns the requested content back in unicode. :param r: Response object to get unicode content from. Tried: 1. charset from content-type 2. fall back and replace all unicode characters :rtype: str z£In requests 3.0, get_unicode_from_response will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)r.r¡N) rHrIr�r rŸr r�Ú UnicodeErrorr�Ú TypeError)r©Ztried_encodingsr¤r4r4r5Úget_unicode_from_responses ü   r³zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~c CsÂ| d¡}tdt|ƒƒD]ž}||dd…}t|ƒdkr¦| ¡r¦ztt|dƒƒ}Wntyptd|ƒ‚Yn0|tvr”|||dd…||<q¶d||||<qd||||<qd  |¡S) z¨Un-escape any percent-escape sequences in a URI that are unreserved characters. This leaves all reserved, illegal and non-ASCII bytes encoded. :rtype: str ú%rrrAéz%Invalid percent-escape sequence: '%s'NÚ) r-Úranger<ÚisalnumÚchrr+rxrÚUNRESERVED_SETrk)ÚuriÚpartsÚiÚhÚcr4r4r5Úunquote_unreserved>s  rÀcCs>d}d}ztt|ƒ|d�WSty8t||d�YS0dS)z¬Re-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. :rtype: str z!#$%&'()*+,/:;=?@[]~z!#$&'()*+,/:;=?@[]~)ÚsafeN)r rÀr)r»Zsafe_with_percentZsafe_without_percentr4r4r5Ú requote_uriVs  rÂé cCsd|>d||>}|S)aConverts a mask from /xx format to a int to be used as a mask for IP's in int format Example: if mask is 24 function returns 0xFFFFFF00 if mask is 24 and totalbits=128 function returns 0xFFFFFF00000000000000000000000000 :rtype: int rr4)ÚmaskZ totalbitsÚbitsr4r4r5Ú_get_mask_bitsls rÆc CsØ| d¡\}}t|ƒrXt|ƒrXt dt |¡¡d}tt|ƒƒ}t dt |¡¡d}npt|ƒrÄt|ƒrÄt dt  tj |¡¡\}}|d>|A}tt|ƒdƒ}t dt  tj |¡¡\} } | d>| A}ndS||@||@kS)a3This function allows you to check if an IP belongs to a network subnet Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24 returns False if ip = 192.168.1.1 and net = 192.168.100.0/24 returns True if ip = 1:2:3:4::1 and net = 1:2:3:4::/64 :rtype: bool rjz>Lrz>QQé@é€F) r-Úis_ipv4_addressÚstructÚunpackÚsocketZ inet_atonrÆr+Úis_ipv6_addressÚ inet_ptonÚAF_INET6) ÚipÚnetZnetaddrrÅZipaddrÚnetmaskÚnetworkZ ipaddr_msbZ ipaddr_lsbZ network_msbZ network_lsbr4r4r5Úaddress_in_networkzs"  ÿ ÿrÔcCs&ddd|>dA}t t d|¡¡S)z�Converts mask from /xx format to xxx.xxx.xxx.xxx Example: if mask is 24 function returns 255.255.255.0 :rtype: str lÿÿrrÃz>I)rÌZ inet_ntoarÊÚpack)rÄrÅr4r4r5Údotted_netmask—srÖcCs.zt tj|¡Wntjy(YdS0dS©z :rtype: bool FT)rÌrÎZAF_INETÚerror©Z string_ipr4r4r5rÉ¢s rÉcCs.zt tj|¡Wntjy(YdS0dSr×)rÌrÎrÏrØrÙr4r4r5rÍ­s rÍcCsD||kr dSzt tj|¡t tj|¡kWSty>YdS0dS)zW Compare 2 IP's, uses socket.inet_pton to normalize IPv6 IPs :rtype: bool TFN)rÌrÎrÏr,)Úar>r4r4r5Ú compare_ips¸sÿ rÛcCsˆ| d¡dkr€| d¡\}}z t|ƒ}Wnty<YdS0t|ƒr\|dksV|dkr~dSq„t|ƒrz|dkst|dkr~dSq„dSndSdS)zV Very simple check of the cidr format in no_proxy variable. :rtype: bool rjrFrÃrÈT)Úcountr-r+rxrÉrÍ)Zstring_networkÚaddressrÄr4r4r5Ú is_valid_cidrÈs  rÞc cst|du}|r"tj |¡}|tj|<z*dVW|rp|durBtj|=qp|tj|<n"|rn|durdtj|=n |tj|<0dS)zÎSet the environment variable 'env_name' to 'value' Save previous value, yield, and then restore the previous value stored in the environment variable 'env_name'. If 'value' is None, do nothingN)rDrUrV)Zenv_namerzZ value_changedÚ old_valuer4r4r5Ú set_environâs    ü ràc CsJdd„}|}|dur|dƒ}t|ƒ}|jdur2dS|râdd„| dd ¡ d ¡Dƒ}t|jƒsft|jƒr |D]2}t|ƒrŠt|j|ƒrœdSqjt|j|ƒrjdSqjnB|j}|j r¼|d   |j ¡7}|D] }|j  |¡sÚ|  |¡rÀdSqÀt d|ƒ�>zt |jƒ}Wnttjf�yd }Yn0Wdƒn1�s20Y|�rFdSd S) zL Returns whether we should bypass proxies or not. :rtype: bool cSstj |¡ptj | ¡¡S©N)rDrUrVÚupper)Úkr4r4r5ÚrRz'should_bypass_proxies..NÚno_proxyTcss|]}|r|VqdSrár4)rOr2r4r4r5rQsz(should_bypass_proxies..ú r¶ú,z:{}F)r r\r.r-rÉrÍrÞrÔrÛÚportrNÚendswithràrr²rÌZgaierror) r^råZ get_proxyZ no_proxy_argÚparsedZproxy_ipZhost_with_portr2Zbypassr4r4r5Úshould_bypass_proxiesøs@ ÿ    *rëcCst||d�riStƒSdS)zA Return a dict of environment proxies. :rtype: dict )råN)rër)r^rår4r4r5Úget_environ_proxies5s rìcCst|pi}t|ƒ}|jdur.| |j| d¡¡S|jd|j|jd|jdg}d}|D]}||vrV||}qpqV|S)z­Select a proxy for the url, if applicable. :param url: The url being for the request :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs NÚallz://zall://)r r\rVÚscheme)r^ZproxiesZurlpartsZ proxy_keysÚproxyZ proxy_keyr4r4r5Ú select_proxyAs ürðúpython-requestscCs d|tfS)zO Return a string representing the default user agent. :rtype: str z%s/%sr)rar4r4r5Údefault_user_agent[sròcCsttƒd d¡dddœƒS)z9 :rtype: requests.structures.CaseInsensitiveDict z, )ÚgzipZdeflatez*/*z keep-alive)z User-AgentzAccept-EncodingZAcceptZ Connection)rròrkr4r4r4r5Údefault_headersds ürôc CsÊg}d}| |¡}|s|St d|¡D]ž}z| dd¡\}}WntyZ|d}}Yn0d| d¡i}| d¡D]D}z| d¡\}}Wnty¢YqºYn0| |¡|| |¡<qt| |¡q&|S) z¼Return a list of parsed link headers proxies. i.e. Link: ; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" :rtype: list z '"z, * '"r…)r’r/r-rxr�) rzZlinksZ replace_charsÚvalr^r˜Úlinkr™ršr4r4r5Úparse_header_linksps&     r÷úÚasciirAécCsÐ|dd…}|tjtjfvr dS|dd…tjkr6dS|dd…tjtjfvrRdS| t¡}|dkrhd S|dkrœ|ddd…tkr†d S|d dd…tkrœd S|dkrÌ|dd…t kr¸d S|d d…t krÌdSdS)z :rtype: str Nézutf-32rúz utf-8-sigrAzutf-16rržz utf-16-berz utf-16-lez utf-32-bez utf-32-le) r¥Ú BOM_UTF32_LEÚ BOM_UTF32_BEÚBOM_UTF8Ú BOM_UTF16_LEÚ BOM_UTF16_BErÜÚ_nullÚ_null2Ú_null3)ÚdataZsampleZ nullcountr4r4r5Úguess_json_utf›s*  rcCs8t||ƒ\}}}}}}|s$||}}t||||||fƒS)zªGiven a URL that may or may not have a scheme, prepend the given scheme. Does not replace a present scheme with the one provided as an argument. :rtype: str )r r)r^Z new_schemerîÚnetlocrXr˜ÚqueryÚfragmentr4r4r5Úprepend_scheme_if_needed»s r c Cs@t|ƒ}zt|jƒt|jƒf}Wnttfy:d}Yn0|S)z{Given a url with authentication components, extract them into a tuple of username,password. :rtype: (str,str) )r¶r¶)r r ÚusernameÚpasswordr]r²)r^rêZauthr4r4r5Úget_auth_from_urlÌs  r s^\S[^\r\n]*$|^$z^\S[^\r\n]*$|^$c Csd|\}}t|tƒrt}nt}z| |¡s4td|ƒ‚Wn(ty^td||t|ƒfƒ‚Yn0dS)zÕVerifies that header value is a string which doesn't contain leading whitespace or return characters. This prevents unintended header injection. :param header: tuple, in the format (name, value). z7Invalid return character or leading space in header: %sz>Value for header {%s: %s} must be of type str or bytes, not %sN)rfr Ú_CLEAN_HEADER_REGEX_BYTEÚ_CLEAN_HEADER_REGEX_STRr0rr²Útype)r•rarzÚpatr4r4r5Úcheck_header_validityás    ÿrcCsFt|ƒ\}}}}}}|s"||}}| dd¡d}t|||||dfƒS)zW Given a url remove the fragment and the authentication part. :rtype: str ú@rrcr¶)r Úrsplitr)r^rîrrXr˜rrr4r4r5Ú urldefragauthös  rc Cs^t|jddƒ}|durRt|jtƒrRz||jƒWqZttfyNtdƒ‚YqZ0ntdƒ‚dS)zfMove file pointer back to its recorded starting position so it can be read again on redirect. r@Nz;An error occurred when rewinding request body for redirect.z+Unable to rewind request body for redirect.)reÚbodyrfZ_body_positionrrJr,r)Zprepared_requestZ body_seekr4r4r5Ú rewind_bodysr)F)F)rÃ)N)rñ)eÚ__doc__r¥Ú contextlibrBrDr/rÌrÊÚsysrorHrlÚ collectionsrrr¶rZ_internal_utilsrÚcompatrrr r r r r rrrrrrrrrZcookiesrZ structuresrÚ exceptionsrrrrrWÚwhereZDEFAULT_CA_BUNDLE_PATHZ DEFAULT_PORTSÚplatformr6r:rMr`rirur{r}r„r†r€rŠr‹r‘r›r r­r°r³Ú frozensetrºrÀrÂrÆrÔrÖrÉrÍrÛrÞÚcontextmanagerràrërìrðròrôr÷Úencoderrrrr r rŽr rrrrr4r4r4r5Ús–     @    '  = 3  #   %ÿ     =   &