o !Qd@s ddlZddlZddlZddlZddlZgdZgdZgdZgdZgdZ gdZ gdZ d Z d Z gd Zd ZiZd dZdZdZddZeefddZeefddZddZGdddeZGdddeZGdddeZGdd d eeZGd!d"d"eeZdd#lmZed$d%Zed&d'Z ed(d)Z!d*e_"d+ej#_"d,ej$_"d-e _"d.e j%_"d/e j&_"d0e j'_"d1e j(_"d2e j$_"d3e!_"e j%j"e!j%_"e j&j"e!j&_"e j'j"e!j'_"d4e!j)_"e j(j"e!j(_"e j$j"e!j$_"eZ*Gd5d$d$eeZ+Gd6d&d&e eZ,Gd7d(d(e!eZ-Gd8d9d9eeZ.Gd:d;d;e eZ/Gdd?Z1e1[1ddBdCZ2dDdEZ3ddFdGZ4dHdIZ5ddJdKZ6dLdMZ7dNdOZ8ddPdQZ9dRdSZ:dTZ;dadWZ?ddZd[Z@ \ ]dd^d_ZA \ ]dd`daZBddbdcZCeDddZEeFeEZGiZHGdedfdfejIZJddhdiZKddjdkZLddldmZMd\d@ddeLfdndoZNdpdqZOdrdsZPdtduZQdvdwZRdaSdxdyZTdzd{ZUdaVd|d}ZWd~dZXddZYddZZddZ[ddZ\da]ddZ^dddZ_dddZ`ddZaddZbddZcddZdddZeddZfddZgddZhdS)N)urlparse urlunparseurljoin urldefragurlsplit urlunsplit urlencodeparse_qs parse_qslquote quote_plusquote_from_bytesunquote unquote_plusunquote_to_bytes DefragResult ParseResult SplitResultDefragResultBytesParseResultBytesSplitResultBytes)ftphttpgophernntpimapwaisfilehttpsshttpmmsprosperortsprtspusftpsvnsvn+sshwswss)rrrrrtelnetrrrr!rr snewsr"r#r$Zrsyncr&r'r%ZnfsZgitzgit+sshr(r))rrhdlr"rrrr r#r$sipsipsr!r%Ztel) rr,Zmailtonewsr*rrr+r-r.) rrrrrr r!rr#r$r-r.) rrr,rrr/rrrr r+rr"zAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!  )   cCs ttdSN) _parse_cacheclear _safe_quotersr8r83/opt/alt/python310/lib64/python3.10/urllib/parse.py clear_cache`s r:asciistrictcCs|Sr4r8)objr8r8r9_nooposr>cCs |||Sr4encode)r=encodingerrorsr8r8r9_encode_resultrs rCcstfdd|DS)Nc3s$|] }|r |ndVqdS)rNdecode.0xrArBr8r9 xs"z_decode_args..)tuple)argsrArBr8rIr9 _decode_argsvsrMcGsVt|dt}|ddD]}|rt|t|krtdq |r$|tfSt|tfS)Nrz$Cannot mix str and non-str arguments) isinstancestr TypeErrorr>rMrC)rLZ str_inputargr8r8r9 _coerce_argszs rSc@eZdZ dZdddZdS)_ResultMixinStrr8r;r<c|jfdd|DS)Nc3|] }|VqdSr4r?rFrIr8r9rJz)_ResultMixinStr.encode..)_encoded_counterpartselfrArBr8rIr9r@z_ResultMixinStr.encodeNr;r<)__name__ __module__ __qualname__ __slots__r@r8r8r8r9rUrUc@rT)_ResultMixinBytesr8r;r<crV)Nc3rWr4rDrFrIr8r9rJrXz+_ResultMixinBytes.decode..)_decoded_counterpartrZr8rIr9rEr\z_ResultMixinBytes.decodeNr])r^r_r`rarEr8r8r8r9rcrbrcc@sLeZdZ dZeddZeddZeddZedd Ze e j Z d S) _NetlocResultMixinBaser8cC |jdS)Nr _userinfor[r8r8r9username z_NetlocResultMixinBase.usernamecCrf)NrNrgrir8r8r9passwordrkz_NetlocResultMixinBase.passwordcCsD|jd}|s dSt|trdnd}||\}}}|||S)Nr%%) _hostinforOrP partitionlower)r[hostname separatorZpercentZzoner8r8r9rrs z_NetlocResultMixinBase.hostnamecCsb|jd}|dur/|r|rt|}ntd|d|kr*dks/tdtd|S)NrNz+Port could not be cast to integer value as rizPort out of range 0-65535)roisdigitisasciiint ValueError)r[portr8r8r9rxs  z_NetlocResultMixinBase.portN) r^r_r`rapropertyrjrlrrrx classmethodtypes GenericAlias__class_getitem__r8r8r8r9res     rec@(eZdZdZeddZeddZdS)_NetlocResultMixinStrr8cCJ|j}|d\}}}|r|d\}}}|sd}||fSd}}||fS)N@:netloc rpartitionrpr[rZuserinfoZ have_infohostinforjZ have_passwordrlr8r8r9rhz_NetlocResultMixinStr._userinfocCl|j}|d\}}}|d\}}}|r&|d\}}}|d\}}}n|d\}}}|s2d}||fS)Nr[]rrr[r_rZ have_open_brZ bracketedrrrxr8r8r9roz_NetlocResultMixinStr._hostinfoNr^r_r`raryrhror8r8r8r9r   rc@r~)_NetlocResultMixinBytesr8cCr)N@:rrr8r8r9rhrz!_NetlocResultMixinBytes._userinfocCr)Nr[]rrrr8r8r9rorz!_NetlocResultMixinBytes._hostinfoNrr8r8r8r9rrr) namedtuplerz url fragmentrz!scheme netloc path query fragmentrz(scheme netloc path params query fragmentz DefragResult(url, fragment) A 2-tuple that contains the url without fragment identifier and the fragment identifier as a separate argument. z$The URL with no fragment identifier.z Fragment identifier separated from URL, that allows indirect identification of a secondary resource by reference to a primary resource and additional identifying information. z SplitResult(scheme, netloc, path, query, fragment) A 5-tuple that contains the different components of a URL. Similar to ParseResult, but does not split params. z%Specifies URL scheme for the request.z0 Network location where the request is made to. z@ The hierarchical path, such as the path to a file to download. z The query component, that contains non-hierarchical data, that along with data in path component, identifies a resource in the scope of URI's scheme and network location. z Fragment identifier, that allows indirect identification of a secondary resource by reference to a primary resource and additional identifying information. zq ParseResult(scheme, netloc, path, params, query, fragment) A 6-tuple that contains components of a parsed URL. z Parameters for last path element used to dereference the URI in order to provide access to perform some operation on the resource. c@eZdZdZddZdS)rr8cC|jr |jd|jS|jSN#fragmenturlrir8r8r9geturlJzDefragResult.geturlNr^r_r`rarr8r8r8r9rH c@r)rr8cCt|Sr4rrir8r8r9rRzSplitResult.geturlNrr8r8r8r9rPrc@r)rr8cCrr4rrir8r8r9rWrzParseResult.geturlNrr8r8r8r9rUrc@r)rr8cCr)N#rrir8r8r9r]rzDefragResultBytes.geturlNrr8r8r8r9r[rrc@r)rr8cCrr4rrir8r8r9rerzSplitResultBytes.geturlNrr8r8r8r9rcrrc@r)rr8cCrr4rrir8r8r9rjrzParseResultBytes.geturlNrr8r8r8r9rhrrcCs4ttfttfttff}|D] \}}||_||_q dSr4)rrrrrrrYrd)Z _result_pairsZ_decodedZ_encodedr8r8r9_fix_result_transcodingns rrTc Csh t||\}}}t|||}|\}}}}}|tvr%d|vr%t|\}}nd}t||||||} || S)N;r)rSr uses_params _splitparamsr) rschemeallow_fragments_coerce_resultZ splitresultrqueryrparamsresultr8r8r9r{s rcCsRd|vr|d|d}|dkr|dfSn|d}|d|||ddfS)N/rrrrN)findrfind)rir8r8r9rs rcCsHt|}dD]}|||}|dkrt||}q|||||dfS)Nz/?#r)lenrmin)rstartdelimcZwdelimr8r8r9 _splitnetlocs  rcCs|r|rdSddl}|dd}|dd}|dd}|dd}|d|}||kr0dSdD]}||vrBtd |d d q2dS) Nrrrrr?NFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)ru unicodedatareplace normalizerw)rrnZnetloc2rr8r8r9 _checknetlocs"       rc Cs t||\}}}|t}|t}tD]}||d}||d}qt|}|||t|t|f}t |d}|r?||St tt krHt d}}} | d} | dkrw|d| D]} | tvrenq]|d| || dd}}|dddkrt|d\}}d|vrd|vsd|vrd|vrtd |rd |vr|d d\}} d |vr|d d\}}t|t||||| } | t|<|| S) NrrrrN//rrzInvalid IPv6 URLrr)rSlstrip_WHATWG_C0_CONTROL_OR_SPACEstrip_UNSAFE_URL_BYTES_TO_REMOVErbooltyper5getrMAX_CACHE_SIZEr:r scheme_charsrqrrwsplitrr) rrrrbkeycachedrrrrrvr8r8r9rsF       " rcCs> t|\}}}}}}}|rd||f}|t|||||fS)Nz%s;%s)rSr) componentsrrrrrrrr8r8r9rs  rcCs t|\}}}}}}|s|r1|tvr1|dddkr1|r)|dddkr)d|}d|p-d|}|r9|d|}|rA|d|}|rI|d|}||S) NrrrNrrrrr)rS uses_netloc)rrrrrrrr8r8r9rs    rc Cs |s|S|s |St||\}}}t|d|\}}}}}} t|||\} } } } }}| |ks1| tvr5||S| tvrI| rG|t| | | | ||fS|} | sa| sa|} |} |sU|}|t| | | | ||fS|d}|ddkro|d=| dddkr}| d}n|| d}td|dd|dd<g}|D] }|dkrz|WqtyYqw|dkrq| |q|ddvr| d|t| | d |pd| ||fS)NrrrN...)rr) rSr uses_relativerrrfilterpop IndexErrorappendjoin)baserrrZbschemeZbnetlocZbpathZbparamsZbqueryZ bfragmentrrpathrrrZ base_partsZsegmentsZ resolved_pathZsegr8r8r9rsf             rc CsV t|\}}d|vr t|\}}}}}}t|||||df}nd}|}|t||S)Nrr)rSrrr) rrsrpaqZfragZdefragr8r8r9r\s rZ0123456789ABCDEFabcdefc Cs |s|jdSt|tr|d}|d}t|dkr|S|dg}|j}tdur2ddtDa|ddD]'}z|t|dd||ddWq8ty_|d||Yq8wd |S) Nutf-8rnrNrcSs.i|]}tD]}||t||qqSr8)_hexdigr@bytesfromhex)rGrrr8r8r9 s z$unquote_to_bytes..r) rrOrPr@rr _hextobyterKeyErrorr)stringbitsresritemr8r8r9ros0        rz([-]+)rrcCs t|trt|||Sd|vr|j|S|durd}|dur#d}t|}|dg}|j}tdt|dD]}|t|||||||dq8d |S)NrmrrrrNrr) rOrrrEr_asciirerrangerr)rrArBrrrrr8r8r9rs"    rF&c CsP i}t|||||||d}|D]\} } | |vr || | q| g|| <q|S)N)rArBmax_num_fieldsrs)r r) qskeep_blank_valuesstrict_parsingrArBrrsZ parsed_resultZpairsnamevaluer8r8r9r s  r cCs" t|\}}t|\}}|rt|ttfstd|dur-d||} || kr-tdg} ||D]Z} | s;|s;q4| dd} t| dkrY|rPtd| f|rX| dnq4t| dsa|r| d d d } t | ||d } || } | d d d }t |||d }||}| | |fq4| S) Nz*Separator must be of type string or bytes.rNzMax number of fields exceeded=rzbad query field: %rrr+ rI) rSrOrPrrwcountrrrrr)rrrrArBrrsrr num_fieldsrZ name_valueZnvrrr8r8r9r s<     r cCs |dd}t|||S)Nrr)rr)rrArBr8r8r9rs  rsBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s&eZdZ ddZddZddZdS)QuotercCs t||_dSr4) _ALWAYS_SAFEunionsafe)r[rr8r8r9__init__/szQuoter.__init__cCsd|jjt|fS)Nz<%s %r>) __class__r^dictrir8r8r9__repr__3szQuoter.__repr__cCs(||jvr t|nd|}|||<|S)Nz%{:02X})rchrformat)r[rrr8r8r9 __missing__7szQuoter.__missing__N)r^r_r`rrrr8r8r8r9r's  rrcCsd t|tr|s |S|durd}|durd}|||}n|dur%td|dur-tdt||S)Nrr<z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)rOrPr@rQr )rrrArBr8r8r9r =s & r cCsf t|tr d|vst|trd|vrt||||St|tr"d}nd}t|||||}|ddS)Nr r)rOrPrr r)rrrArBZspacer8r8r9r ss  r cs t|ttfs td|sdSt|tr|dd}n tdd|D}|t|s0|Szt |Wnt yHt |j t |<Ynwd fdd|DS)Nz!quote_from_bytes() expected bytesrr;ignorecSsg|]}|dkr|qS)r8)rGrr8r8r9 sz$quote_from_bytes..csg|]}|qSr8r8)rGcharZquoterr8r9r s)rOr bytearrayrQrPr@rstrip_ALWAYS_SAFE_BYTESrEr7rr __getitem__r)Zbsrr8rr9r s    r c Cs t|dr |}n%zt|rt|dtstWnty/t\}}}td|wg} |sm|D]5\} } t| t rE|| |} n |t | |||} t| t rY|| |} n |t | |||} | | d| q6n|D]\} } t| t r~|| |} n |t | |||} t| t r|| |} | | d| qot| t r|| |||} | | d| qozt| } Wnty|t | |||} | | d| Yqow| D]} t| t r|| |} n |t | |||} | | d| qqod | S)Nitemsrz1not a valid non-string sequence or mapping objectrr) hasattrrrrOrKrQsysexc_infowith_tracebackrrPrr)rZdoseqrrArBZ quote_viaZtyZvatblkrrHeltr8r8r9rs^                  rcCtjdtddt|S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r stacklevel)warningswarnDeprecationWarning _to_bytesrr8r8r9to_bytessr$cCsH t|tr"z |d}W|Sty!tdt|dw|S)NASCIIzURL z contains non-ASCII characters)rOrPr@rE UnicodeErrorreprr#r8r8r9r"s  r"cCsb t|}|dddkr|dddkr|dd}|dddkr/|dd}|S)NrNzURL:)rPrr#r8r8r9unwraps  r+cCr)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rr r! _splittyper#r8r8r9 splittype r-cCsF tdur tdtjat|}|r|\}}||fSd|fS)Nz ([^/:]+):(.*)) _typeprogrecompileDOTALLmatchgroupsrq)rr3rdatar8r8r9r,s   r,cCr)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rr r! _splithostr#r8r8r9 splithost!r.r7cCsZ tdur tdtjat|}|r)|\}}|r%|ddkr%d|}||fSd|fS)Nz//([^/#?]*)(.*)rr) _hostprogr0r1r2r3r4)rr3Z host_portrr8r8r9r6)s  r6cCr)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rr r! _splituserhostr8r8r9 splituser8r.r<cCs& |d\}}}|r||fSd|fS)Nrr)r;userrr8r8r9r9?sr9cCr)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rr r! _splitpasswd)r>r8r8r9 splitpasswdEr.r@cC$ |d\}}}||r|fSdfSNrrp)r>rZpasswdr8r8r9r?Lr?cCr)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rr r! _splitportr:r8r8r9 splitportRr.rFcCsF tdur tdtjat|}|r|\}}|r||fS|dfS)Nz (.*):([0-9]*)) _portprogr0r1r2 fullmatchr4)r;r3rxr8r8r9rE[s  rErcCstjdtddt||S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rr r! _splitnport)r;defportr8r8r9 splitnportis rKcCsZ |d\}}}|s|}||fS|r)|r#|r#t|}||fSd}||fS||fSrB)rrtrurv)r;rJrrxZnportr8r8r9rIpsrIcCr)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rr r! _splitqueryr#r8r8r9 splitqueryr.rMcC& |d\}}}|r||fS|dfS)Nrr=)rrrrr8r8r9rL rLcCr)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rr r! _splittagr#r8r8r9splittagr.rQcCrNrr=)rrrtagr8r8r9rPrOrPcCr)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rr r! _splitattrr#r8r8r9 splitattrr.rTcCs |d}|d|ddfS)NrrrN)r)rZwordsr8r8r9rSs rScCr)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadrr)rr r! _splitvalue)attrr8r8r9 splitvaluer.rWcCrA)NrrC)rVrrr8r8r9rUrDrU)rT)r)T)rr)FFrrNr)rNN)rNN)r)r)ir0rr{ collectionsr__all__rrrZnon_hierarchicalZ uses_queryZ uses_fragmentrrrrr5r:Z_implicit_encodingZ_implicit_errorsr>rCrMrSobjectrUrcrerrrZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBase__doc__rrrrrrrZ ResultBaserrrrrrrrrrrrrrrrrrrr1rrr r r frozensetrrrr7 defaultdictrr r r rr$r"r+r-r/r,r7r8r6r<r9r@r?rFrGrErKrIrMrLrQrPrTrSrWrUr8r8r8r9s!    &           = E   * B   6  Q