o ?Og֪@s ddlZddlZddlZddlZddlZddlZgdZgdZgdZgdZ gdZ gdZ gdZ d Z d Zgd Zd ZiZd dZdZdZddZeefddZeefddZddZGdddeZGdddeZGdddeZGdd d eeZGd!d"d"eeZdd#lmZed$d%Z ed&d'Z!ed(d)Z"d*e _#d+e j$_#d,e j%_#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$e eZ,Gd6d&d&e!eZ-Gd7d(d(e"eZ.Gd8d9d9e eZ/Gd:d;d;e!eZ0Gdd?Z2e2[2ddBdCZ3dDdEZ4ddFdGZ5dHdIZ6dJdKZ7ddLdMZ8dNdOZ9dPdQZ:ddRdSZ;dTdUZdWdXZ?e@dYZAdd\d]ZB ^ _dd`daZC ^ _ddbdcZDddddeZEeFdfZGeHeGZIiZJGdgdhdhejKZLddjdkZMddldmZNddndoZOd^d@ddeNfdpdqZPdrdsZQdtduZRdvdwZSdxdyZTdaUdzd{ZVd|d}ZWdaXd~dZYddZZddZ[ddZ\ddZ]ddZ^da_ddZ`dddZadddZbddZcddZdddZeddZfddZgddZhddZiddZjdS)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_cacheas r:asciistrictcCs|Sr4r8)objr8r8r9_nooppsr>cCs |||Sr4encode)r=encodingerrorsr8r8r9_encode_resultss rCcstfdd|DS)Nc3s$|] }|r |ndVqdS)rNdecode.0xrArBr8r9 ys"z_decode_args..)tuple)argsrArBr8rIr9 _decode_argswsrMcGsVt|dt}|ddD]}|rt|t|krtdq |r$|tfSt|tfS)Nrz$Cannot mix str and non-str arguments) isinstancestr TypeErrorr>rMrC)rLZ str_inputargr8r8r9 _coerce_args{s 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#fragmenturlrir8r8r9geturlKzDefragResult.geturlNr^r_r`rarr8r8r8r9rI c@r)rr8cCt|Sr4rrir8r8r9rSzSplitResult.geturlNrr8r8r8r9rQrc@r)rr8cCrr4rrir8r8r9rXrzParseResult.geturlNrr8r8r8r9rVrc@r)rr8cCr)N#rrir8r8r9r^rzDefragResultBytes.geturlNrr8r8r8r9r\rrc@r)rr8cCrr4rrir8r8r9rfrzSplitResultBytes.geturlNrr8r8r8r9rdrrc@r)rr8cCrr4rrir8r8r9rkrzParseResultBytes.geturlNrr8r8r8r9rirrcCs4ttfttfttff}|D] \}}||_||_q dSr4)rrrrrrrYrd)Z _result_pairsZ_decodedZ_encodedr8r8r9_fix_result_transcodingos 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"       rcCsD|drtd|stddSt|}t|tjr tddS)Nvz\Av[a-fA-F0-9]+\..+\ZzIPvFuture address is invalidz%An IPv4 address cannot be in brackets) startswithrematchrw ipaddressZ ip_addressrOZ IPv4Address)rrZipr8r8r9_check_bracketed_hosts    rcCs 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 d|vrd|vr|dddd} t| |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_charsrqrrwrprsplitrr)rrrrbkeycachedrrrrrZbracketed_hostrr8r8r9rsL       " rcCs> t|\}}}}}}}|rd||f}|t|||||fS)Nz%s;%s)rSr) componentsrrrrrrrr8r8r9rs  rcCs t|\}}}}}}|s|r|tvs|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_pathZsegr8r8r9r%sf             rc CsV t|\}}d|vr t|\}}}}}}t|||||df}nd}|}|t||S)Nrr)rSrrr) rrsrpaqZfragZdefragr8r8r9rjs 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)stringbitsresritemr8r8r9r}s0        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)rrArBr8r8r9r%s  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__AszQuoter.__repr__cCs(||jvr t|nd|}|||<|S)Nz%{:02X})rchrformat)r[rrr8r8r9 __missing__EszQuoter.__missing__N)r^r_r`rr r r8r8r8r9r5s  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 Ks & r cCsf t|tr d|vst|trd|vrt||||St|tr"d}nd}t|||||}|ddS)Nr r)rOrPrr r)rrrArBZspacer8r8r9r s  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)rGcharZquoterr8r9rs)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(r8r8r9unwrap s  r0cCr!)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr")r$r%r& _splittyper(r8r8r9 splittyper2cCsF tdur tdtjat|}|r|\}}||fSd|fS)Nz ([^/:]+):(.*)) _typeprogrcompileDOTALLrgroupsrq)rrrdatar8r8r9r1"s   r1cCr!)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr")r$r%r& _splithostr(r8r8r9 splithost/r3r:cCsZ tdur tdtjat|}|r)|\}}|r%|ddkr%d|}||fSd|fS)Nz//([^/#?]*)(.*)rr) _hostprogrr5r6rr7)rrZ host_portrr8r8r9r97s  r9cCr!)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr")r$r%r& _splituserhostr8r8r9 splituserFr3r?cCs& |d\}}}|r||fSd|fS)Nrr)r>userrr8r8r9r<Msr<cCr!)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr")r$r%r& _splitpasswd)rAr8r8r9 splitpasswdSr3rCcC$ |d\}}}||r|fSdfSNrrp)rArZpasswdr8r8r9rBZrBcCr!)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr")r$r%r& _splitportr=r8r8r9 splitport`r3rIcCsF tdur tdtjat|}|r|\}}|r||fS|dfS)Nz (.*):([0-9]*)) _portprogrr5r6 fullmatchr7)r>rrxr8r8r9rHis  rHrcCstjdtddt||S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr")r$r%r& _splitnport)r>defportr8r8r9 splitnportws rNcCsZ |d\}}}|s|}||fS|r)|r#|r#t|}||fSd}||fS||fSrE)rrtrurv)r>rMrrxZnportr8r8r9rL~srLcCr!)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr")r$r%r& _splitqueryr(r8r8r9 splitqueryr3rPcC& |d\}}}|r||fS|dfS)Nrr@)rrrrr8r8r9rO rOcCr!)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr")r$r%r& _splittagr(r8r8r9splittagr3rTcCrQrr@)rrrtagr8r8r9rSrRrScCr!)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr")r$r%r& _splitattrr(r8r8r9 splitattrr3rWcCs |d}|d|ddfS)NrrrN)r)rZwordsr8r8r9rVs rVcCr!)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadrr")r$r%r& _splitvalue)attrr8r8r9 splitvaluer3rZcCrD)NrrF)rYrrr8r8r9rXrGrX)rT)r)T)rr)FFrrNr)rNN)rNN)r)r)krrr{ collectionsr$r__all__rrrZnon_hierarchicalZ uses_queryZ uses_fragmentrrrrr5r:Z_implicit_encodingZ_implicit_errorsr>rCrMrSobjectrUrcrerrrZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBase__doc__rrrrrrrZ ResultBaserrrrrrrrrrrrrrrrrrrrr5rrr r r frozensetrrrr7 defaultdictrr r r rr)r'r0r2r4r1r:r;r9r?r<rCrBrIrJrHrNrLrPrOrTrSrWrVrZrXr8r8r8r9s!    &           ? E   * B   6  Q