o hr@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[2ddBdCZ3dDdEZ4ddFdGZ5dHdIZ6dJdKZ7dLdMZ8ddNdOZ9dPdQZ:dRdSZ;ddTdUZda?dYdZZ@eAd[ZBdd^d_ZC ` addbdcZD ` addddeZEddfdgZFeGdhZHeIeHZJiZKGdidjdjejLZMddldmZNddndoZOddpdqZPd`d@ddeOfdrdsZQdtduZRdvdwZSdxdyZTdzd{ZUdaVd|d}ZWd~dZXdaYddZZddZ[ddZ\ddZ]ddZ^ddZ_da`ddZadddZbdddZcddZdddZeddZfddZgddZhddZiddZjddZkdS)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_r have_open_br 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"       rcCsr|dd}|d\}}}|r+|rtd|d\}}}|r*|ds*tdn|d\}}}t|dS)NrrInvalid IPv6 URLrr)rrprw startswith_check_bracketed_host)rZhostname_and_portZbefore_bracketrrrrrrxr8r8r9_check_bracketed_netlocs rcCsD|drtd|stddSt|}t|tjr tddS)Nvz\Av[a-fA-F0-9]+\..+\ZzIPvFuture address is invalidz%An IPv4 address cannot be in brackets)rrematchrw ipaddressZ ip_addressrOZ IPv4Address)rrZipr8r8r9rs    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 d|vrd|vrt||rd |vr|d d\}} d |vr|d d\}}t|t||||| } | t|<|| S) NrrrrNr//rrrrr)rSlstrip_WHATWG_C0_CONTROL_OR_SPACEstrip_UNSAFE_URL_BYTES_TO_REMOVErbooltyper5getrMAX_CACHE_SIZEr:r scheme_charsrqrrwrsplitrr) rrrrbkeycachedrrrrrrr8r8r9rsJ       " 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)rrrrrrrr8r8r9r"s    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_pathZsegr8r8r9r5sf             rc CsV t|\}}d|vr t|\}}}}}}t|||||df}nd}|}|t||S)Nrr)rSrrr) rrsrpaqZfragZdefragr8r8r9rzs 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)stringbitsresritemr8r8r9rs0        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)rrArBr8r8r9r5s  rsBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s&eZdZ ddZddZddZdS)QuotercCs t||_dSr4) _ALWAYS_SAFEunionsafe)r[r r8r8r9__init__MszQuoter.__init__cCsd|jjt|fS)Nz<%s %r>) __class__r^dictrir8r8r9__repr__QszQuoter.__repr__cCs(||jvr t|nd|}|||<|S)Nz%{:02X})r chrformat)r[rrr8r8r9 __missing__UszQuoter.__missing__N)r^r_r`r rrr8r8r8r9rEs  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 )rr rArBr8r8r9r [s & r cCsf t|tr d|vst|trd|vrt||||St|tr"d}nd}t|||||}|ddS)Nr r)rOrPrr r)rr rArBZspacer8r8r9r 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)Zbsr r8rr9r 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)rZdoseqr rArBZ quote_viaZtyZvatblkrrHeltr8r8r9rs^                  rcCtjdtddt|S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r stacklevel)warningswarnDeprecationWarning _to_bytesrr8r8r9to_bytes sr-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  r4cCr%)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr&)r(r)r* _splittyper,r8r8r9 splittype*r6cCsF tdur tdtjat|}|r|\}}||fSd|fS)Nz ([^/:]+):(.*)) _typeprogrcompileDOTALLrgroupsrq)rrrdatar8r8r9r52s   r5cCr%)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr&)r(r)r* _splithostr,r8r8r9 splithost?r7r>cCsZ tdur tdtjat|}|r)|\}}|r%|ddkr%d|}||fSd|fS)Nz//([^/#?]*)(.*)rr) _hostprogrr9r:rr;)rrZ host_portrr8r8r9r=Gs  r=cCr%)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr&)r(r)r* _splituserhostr8r8r9 splituserVr7rCcCs& |d\}}}|r||fSd|fS)Nrr)rBuserrr8r8r9r@]sr@cCr%)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr&)r(r)r* _splitpasswd)rEr8r8r9 splitpasswdcr7rGcC$ |d\}}}||r|fSdfSNrrp)rErZpasswdr8r8r9rFjrFcCr%)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr&)r(r)r* _splitportrAr8r8r9 splitportpr7rMcCsF tdur tdtjat|}|r|\}}|r||fS|dfS)Nz (.*):([0-9]*)) _portprogrr9r: fullmatchr;)rBrrxr8r8r9rLys  rLrcCstjdtddt||S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr&)r(r)r* _splitnport)rBdefportr8r8r9 splitnports rRcCsZ |d\}}}|s|}||fS|r)|r#|r#t|}||fSd}||fS||fSrI)rrtrurv)rBrQrrxZnportr8r8r9rPsrPcCr%)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr&)r(r)r* _splitqueryr,r8r8r9 splitqueryr7rTcC& |d\}}}|r||fS|dfS)NrrD)rrrrr8r8r9rS rScCr%)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr&)r(r)r* _splittagr,r8r8r9splittagr7rXcCrUrrD)rrrtagr8r8r9rWrVrWcCr%)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr&)r(r)r* _splitattrr,r8r8r9 splitattrr7r[cCs |d}|d|ddfS)NrrrN)r)rZwordsr8r8r9rZs rZcCr%)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadrr&)r(r)r* _splitvalue)attrr8r8r9 splitvaluer7r^cCrH)NrrJ)r]rrr8r8r9r\rKr\)rT)r)T)rr)FFrrNr)rNN)rNN)r)r)lrrr{ collectionsr(r__all__rrrZnon_hierarchicalZ uses_queryZ uses_fragmentrrrrr5r:Z_implicit_encodingZ_implicit_errorsr>rCrMrSobjectrUrcrerrrZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBase__doc__rrrrrrrZ ResultBaserrrrrrrrrrrrrrrrrrrrrr9rrr r r frozensetrrrr7 defaultdictrr r r rr-r+r4r6r8r5r>r?r=rCr@rGrFrMrNrLrRrPrTrSrXrWr[rZr^r\r8r8r8r9s!    &           > E   * B   6  Q