U &.e@sddlZddlZddlZddlZddlZdddddddd d d d d dddddddddgZdddddddddd d!d"d#d$d%d&d'd(d)gZdddddd*dddd!dd d+d"d#d$d,d&d'd%d-d.d/d(d)gZddd0d"dddd d#d$d1d2d!d%d3gZdd0d4d5d*ddd+d1d2g Z dddddd d!dd#d$d1d2g Z ddd0ddd5dddd d+dd"g Z d6Z d7Z d8d9d:gZd;ZiZdZd?Zd@dAZeefdBdCZeefdDdEZdFdGZGdHdIdIeZGdJdKdKeZGdLdMdMeZGdNdOdOeeZGdPdQdQeeZddRlmZeddSZeddTZ eddUZ!dVe_"dWej#_"dXej$_"dYe _"dZe j%_"d[e j&_"d\e j'_"d]e j(_"d^e j$_"d_e!_"e j%j"e!j%_"e j&j"e!j&_"e j'j"e!j'_"d`e!j)_"e j(j"e!j(_"e j$j"e!j$_"eZ*GdaddeeZ+Gdbdde eZ,Gdcdde!eZ-GddddeeZ.Gdedde eZ/Gdfdde!eZ0dgdhZ1e1[1ddjdZ2dkdlZ3ddmdnZ4dodpZ5dqdrZ6ddsdZ7dtdZ8dudZ9ddvdZ:dwdZ;dxZe?dzZ@dd}dZAddd ZBGdddeCZDdZEdaFddd ZGdddZHeIdZJeKeJZLiZMGdddejNZOddd ZPddd ZQddd ZRd~dddeQfddZSddZTddZUddZVddZWdaXddZYddZZda[ddZ\ddZ]ddZ^ddZ_ddZ`ddZadabddZcdddZddddZeddZfddZgddZhddZiddZjddZkddZlddZmdS)Nurlparse urlunparseurljoin urldefragurlsplit urlunsplit urlencodeparse_qs parse_qslquote quote_plusquote_from_bytesunquote unquote_plusunquote_to_bytes DefragResult ParseResult SplitResultDefragResultBytesParseResultBytesSplitResultBytesZftphttpZgopherZnntpZimapZwaisfileZhttpsZshttpZmmsZprosperoZrtspZrtspuZsftpZsvnzsvn+sshZwsZwssZtelnetZsnewsZrsyncZnfsZgitzgit+sshZhdlZsipZsipsZtelZmailtoZnewszAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!     cCsttdSN) _parse_cacheclear _safe_quotersr"r"$/usr/lib64/python3.8/urllib/parse.py clear_cache`sr$asciistrictcCs|Srr")objr"r"r#_nooposr(cCs |||Srencode)r'encodingerrorsr"r"r#_encode_resultrsr-cstfdd|DS)Nc3s"|]}|r|ndVqdS)rNdecode.0xr+r,r"r# xsz_decode_args..)tuple)argsr+r,r"r3r# _decode_argsvsr7cGsVt|dt}|ddD]}|rt|t|krtdq|rH|tfSt|tfS)Nrz$Cannot mix str and non-str arguments) isinstancestr TypeErrorr(r7r-)r6Z str_inputargr"r"r# _coerce_argszs  r=c@seZdZdZdddZdS)_ResultMixinStrr"r%r&cs|jfdd|DS)Nc3s|]}|VqdSrr)r0r3r"r#r4sz)_ResultMixinStr.encode..)_encoded_counterpartselfr+r,r"r3r#r*sz_ResultMixinStr.encodeN)r%r&)__name__ __module__ __qualname__ __slots__r*r"r"r"r#r>sr>c@seZdZdZdddZdS)_ResultMixinBytesr"r%r&cs|jfdd|DS)Nc3s|]}|VqdSrr.r0r3r"r#r4sz+_ResultMixinBytes.decode..)_decoded_counterpartr@r"r3r#r/sz_ResultMixinBytes.decodeN)r%r&)rBrCrDrEr/r"r"r"r#rFsrFc@s@eZdZdZeddZeddZeddZedd Zd S) _NetlocResultMixinBaser"cCs |jdS)Nr _userinforAr"r"r#usernamesz_NetlocResultMixinBase.usernamecCs |jdS)Nr8rIrKr"r"r#passwordsz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|tr dnd}||\}}}|||S)Nr%%) _hostinfor9r: partitionlower)rAhostname separatorZpercentZzoner"r"r#rSs  z_NetlocResultMixinBase.hostnamecCsl|jd}|dk rhzt|d}Wn(tk rHd|}t|dYnXd|kr^dkshntd|S)Nr8 z+Port could not be cast to integer value as rizPort out of range 0-65535)rPint ValueError)rAportmessager"r"r#rXs  z_NetlocResultMixinBase.portN) rBrCrDrEpropertyrLrMrSrXr"r"r"r#rHs   rHc@s(eZdZdZeddZeddZdS)_NetlocResultMixinStrr"cCsD|j}|d\}}}|r4|d\}}}|s.)r=rlstrip_WHATWG_C0_CONTROL_OR_SPACEstripbooltypergetrMAX_CACHE_SIZEr$rrrWsplitrr scheme_charsanyrR) rrr|r}r~keycachedr_rrqrvrrestr"r"r#rsn           cCs<t|\}}}}}}}|r&d||f}|t|||||fS)Nz%s;%s)r=r) componentsr|r_rrrrrqr~r"r"r#rs  cCst|\}}}}}}|s4|r`|tkr`|dddkr`|rP|dddkrPd|}d|pXd|}|rp|d|}|r|d|}|r|d|}||S) Nrrr8rrr]rro)r= uses_netloc)rr|r_rrrrqr~r"r"r#rs    c Cs|s|S|s|St||\}}}t|d|\}}}}}} t|||\} } } } }}| |ks`| tkrh||S| tkr| r|t| | | | ||fS|} | s| s|} |} |s|}|t| | | | ||fS|d}|ddkr|d=| dddkr| d}n(|| d}td|dd|dd<g}|D]P}|dkr\z |Wntk rXYnXn|dkrlq(n | |q(|ddkr| d|t| | d |pd| ||fS)Nrrr8...)rr) r=r uses_relativerrrfilterpop IndexErrorappendjoin)baserrr}r~ZbschemeZbnetlocZbpathZbparamsZbqueryZ bfragmentr|r_pathrrrqZ base_partsZsegmentsZ resolved_pathZsegr"r"r#rsp            c CsTt|\}}d|kr>t|\}}}}}}t|||||df}nd}|}|t||S)Nror)r=rrr) rrr~srpaqZfragZdefragr"r"r#rTs Z0123456789ABCDEFabcdefc Cs|s|jdSt|tr"|d}|d}t|dkr<|S|dg}|j}tdkrbddtDa|ddD]R}z(|t|dd||ddWqntk r|d||YqnXqnd |S) Nutf-8rOr8rcSs.i|]&}tD]}||t||q qSr")_hexdigr*bytesfromhex)r1rrr"r"r# zs  z$unquote_to_bytes..r) rr9r:r*rr _hextobyterKeyErrorr)stringbitsresritemr"r"r#rgs,     z([-]+)rrcCst|trtdd|kr$|j|S|dkr0d}|dkr|| | q| g|| <q|S)N)r+r,max_num_fieldsrT)r r) qskeep_blank_valuesstrict_parsingr+r,rrTZ parsed_resultpairsnamevaluer"r"r#r s  c@s eZdZdS)_QueryStringSeparatorWarningN)rBrCrDr"r"r"r#rsrz/etc/python/urllib.cfgc Cst|\}}t|tr |d}|r2t|ttfsB|dk rBtdt}|dkrRt}d} |dkrrtj | }d} |dkrz t t } Wnt k rYnJX| :ddl} | jddd} | | | j d| dd }|aW5QRXt } |dkrd |krdd lm}|d td dd}n:|dkr(|}n*t|dkrRt| d| ddd|dk r||krd|d|d }nd||}||krtd||krdd|dD}ndd||D}g}|D]}|s|sq|dd}t|d kr4|rtd|f|r|dnqt|dsH|r|ddd}t|||d}||}|ddd}t|||d}||}|||fq|S) Nr%z*Separator must be of type string or bytes.ZPYTHON_URLLIB_QS_SEPARATORzenvironment variabler)ro)Z interpolationZcomment_prefixesr )Zfallbackry)warnaThe default separator of urllib.parse.parse_qsl and parse_qs was changed to '&' to avoid a web cache poisoning issue (CVE-2021-23336). By default, semicolons no longer act as query field separators. See https://access.redhat.com/articles/5860431 for more details.r stacklevel&Zlegacyr8z (from z) must contain z1 character, or "legacy". See z7s zparse_qsl..cSsg|]}|qSr"r")r1rr"r"r#r9s=zbad query field: %rr+ r3)r=r9rr/r:rWobject_default_qs_separatorosenvironropen_QS_SEPARATOR_CONFIG_FILENAMEFileNotFoundError configparserZ ConfigParserZ read_filewarningsrrrcountrrrr)rrrr+r,rrTr~Z_legacyZ envvar_nameZ config_sourcerrZconfigr num_fieldsrrZ name_valueZnvrrr"r"r#r s                  cCs|dd}t|||S)Nrr)rr)rr+r,r"r"r#rQs sBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s$eZdZddZddZddZdS)QuotercCst||_dSr) _ALWAYS_SAFEunionsafe)rArr"r"r#__init__iszQuoter.__init__cCsd|jjt|fS)Nz<%s %r>) __class__rBdictrKr"r"r#__repr__mszQuoter.__repr__cCs(||jkrt|nd|}|||<|S)Nz%{:02X})rchrformat)rArrr"r"r# __missing__qszQuoter.__missing__N)rBrCrDrrrr"r"r"r#rasrrcCsbt|tr8|s|S|dkrd}|dkr*d}|||}n |dk rHtd|dk rXtdt||S)Nrr&z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r9r:r*r;r )rrr+r,r"r"r#r ws' cCsdt|trd|ks$t|tr2d|kr2t||||St|trBd}nd}t|||||}|ddS)Nr r)r9r:rr r)rrr+r,Zspacer"r"r#r s cst|ttfstd|sdSt|tr6|dd}ntdd|D}|t|s^|Sz t |Wn&t k rt |j t |<YnXd fdd|DS)Nz!quote_from_bytes() expected bytesrr%ignorecSsg|]}|dkr|qS)r"rr"r"r#rsz$quote_from_bytes..csg|] }|qSr"r")r1charZquoterr"r#rs)r9r bytearrayr;r:r*rstrip_ALWAYS_SAFE_BYTESr/r!rr __getitem__r)Zbsrr"rr#r s  c Cs t|dr|}nPzt|r0t|dts0tWn0tk rbt\}}}td|YnXg} |s|D]j\} } t| t r|| |} n|t | |||} t| t r|| |} n|t | |||} | | d| qpn"|D]\} } t| t r|| |} n|t | |||} t| t rB|| |} | | d| qt| t rp|| |||} | | d| qz t| } Wn:tk r|t | |||} | | d| YqX| D]B} t| t r|| |} n|t | |||} | | d| qqd | S)Nitemsrz1not a valid non-string sequence or mapping objectrr) hasattrrrr9r5r;sysexc_infowith_tracebackrr:rr)rZdoseqrr+r,Z quote_viaZtyZvatblkrr2Zeltr"r"r#rsR                cCstjdtddt|S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8rr)rrDeprecationWarning _to_bytesrrr"r"r#to_bytes%s rcCsJt|trFz|d}Wn(tk rDtdt|dYnX|S)NASCIIzURL z contains non-ASCII characters)r9r:r*r/ UnicodeErrorreprrr"r"r#r+s   rcCs`t|}|dddkr<|dddkr<|dd}|dddkr\|dd}|S)Nr8zURL:)r:rrr"r"r#unwrap9s   r cCstjdtddt|S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr _splittyperr"r"r# splittypeFs rcCsDtdkrtdtjat|}|r<|\}}||fSd|fS)Nz ([^/:]+):(.*)) _typeprogrecompileDOTALLmatchgroupsrR)rrrr|datar"r"r#rNs   rcCstjdtddt|S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr _splithostrr"r"r# splithost[s rcCsXtdkrtdtjat|}|rP|\}}|rH|ddkrHd|}||fSd|fS)Nz//([^/#?]*)(.*)rr) _hostprogrrrrr)rrrZ host_portrr"r"r#rcs  rcCstjdtddt|S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr _splituserhostr"r"r# splituserrs rcCs |d\}}}|r|nd|fS)Nr\r`)ruserrr"r"r#rysrcCstjdtddt|S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr _splitpasswd)rr"r"r# splitpasswds r!cCs |d\}}}||r|ndfSNr]rQ)rrZpasswdr"r"r#r sr cCstjdtddt|S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr _splitportrr"r"r# splitports r%cCsDtdkrtdtjat|}|r<|\}}|r<||fS|dfS)Nz (.*):([0-9]*)) _portprogrrr fullmatchr)rrrXr"r"r#r$s  r$rcCstjdtddt||S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr _splitnport)rdefportr"r"r# splitnports r*cCsT|d\}}}|s|}n2|rLz t|}Wntk rBd}YnX||fS||fSr")r`rVrW)rr)rrXZnportr"r"r#r(s  r(cCstjdtddt|S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr _splitqueryrr"r"r# splitquerys r,cCs$|d\}}}|r||fS|dfS)Nrr)rrrrrr"r"r#r+sr+cCstjdtddt|S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr _splittagrr"r"r#splittags r.cCs$|d\}}}|r||fS|dfSrnr)rrrrtagr"r"r#r-sr-cCstjdtddt|S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr _splitattrrr"r"r# splitattrs r1cCs|d}|d|ddfS)Nryrr8r)rrZwordsr"r"r#r0s r0cCstjdtddt|S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadrr)rrr _splitvalue)attrr"r"r# splitvalues r4cCs |d\}}}||r|ndfS)Nrr#)r3rrr"r"r#r2sr2)rT)r)rT)T)rr)FFrrNN)FFrrNN)rr)rNN)rNN)r)r)r)nrrr collectionsr__all__rrrzZnon_hierarchicalZ uses_queryZ uses_fragmentrrrrrr$Z_implicit_encodingZ_implicit_errorsr(r-r7r=rr>rFrHr[rhrmZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBase__doc__rrrqr|r_rrrZ ResultBaserrrrrrrxrr{rrrrrrrrrrrrrrr RuntimeWarningrrrr r frozensetrrrr! defaultdictrr r r rrrr rrrrrrrrr!r r%r&r$r*r(r,r+r.r-r1r0r4r2r"r"r"r#"s        %           ?  E   ) }  6   Q