a XC?h���@sdZddlZddlZddlZddlZddlZddlZgd�Zgd�Zgd�Z gd�Z gd�Z gd�Z gd �Z d Zd Zgd �Zd ZiZdd�ZdZdZdd�Zeefdd�Zeefdd�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!ee�ZGd"d#�d#ee�Zdd$lm Z e d%d&�Z!e d'd(�Z"e d)d*�Z#d+e!_d,e!j$_d-e!j%_d.e"_d/e"j&_d0e"j'_d1e"j(_d2e"j)_d3e"j%_d4e#_e"j&je#j&_e"j'je#j'_e"j(je#j(_d5e#j*_e"j)je#j)_e"j%je#j%_eZ+Gd6d%�d%e!e�Z,Gd7d'�d'e"e�Z-Gd8d)�d)e#e�Z.Gd9d:�d:e!e�Z/Gd;d<�d�d>e#e�Z1d?d@�Z2e2�[2d�dCdD�Z3dEdF�Z4d�dGdH�Z5dIdJ�Z6dKdL�Z7dMdN�Z8d�dOdP�Z9dQdR�Z:dSdT�Z;d�dUdV�Zda?dZd[�Z@e�Ad\�ZBd�d_d`�ZCd�dcdd�ZDd�dedf�ZEd�dgdh�ZFeGdi�ZHeIeH�ZJiZKGdjdk�dkejL�ZMd�dmdn�ZNd�dodp�ZOd�dqdr�ZPdadAddeOfdsdt�ZQdudv�ZRdwdx�ZSdydz�ZTd{d|�ZUdaVd}d~�ZWdd��ZXdaYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^d�d��Z_da`d�d��Zad�d�d��Zbd�d�d��Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��ZkdS)�a3Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, December 1999. RFC 2396: "Uniform Resource Identifiers (URI)": Generic Syntax by T. Berners-Lee, R. Fielding, and L. Masinter, August 1998. RFC 2368: "The mailto URL scheme", by P.Hoffman , L Masinter, J. Zawinski, July 1998. RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June 1995. RFC 1738: "Uniform Resource Locators (URL)" by T. Berners-Lee, L. Masinter, M. McCahill, December 1994 RFC 3986 is considered the current standard and any future changes to urlparse module should conform with it. The urlparse module is currently not entirely compliant with this RFC due to defacto scenarios for parsing, and for backward compatibility purposes, some parsing quirks from older RFCs are retained. The testcases in test_urlparse.py provides a good indicator of parsing behavior. The WHATWG URL Parser spec should also be considered. We are not compliant with it either due to existing user code API behavior expectations (Hyrum's Law). It serves as a useful guide when making changes. �N)�urlparse� urlunparse�urljoin� urldefrag�urlsplit� urlunsplit� urlencode�parse_qs� parse_qsl�quote� quote_plus�quote_from_bytes�unquote� unquote_plus�unquote_to_bytes� DefragResult� ParseResult� SplitResult�DefragResultBytes�ParseResultBytes�SplitResultBytes)��ftp�http�gopher�nntp�imap�wais�file�https�shttp�mms�prospero�rtsp�rtspu�sftp�svn�svn+ssh�ws�wss)rrrrr�telnetrrrr!rr �snewsr"r#r$Zrsyncr&r'r%ZnfsZgitzgit+sshr(r))rr�hdlr"rrrr r#r$�sip�sipsr!r%Ztel) rr,Zmailto�newsr*rrr+r-r.) rrrrrr r!rr#r$r-r.) rrr,rrr/rrrr r+rr"zAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!  )� � � �cCst��t��dS)z,Clear the parse cache and the quoters cache.N)� _parse_cache�clear� _safe_quoters�r7r7�1/opt/alt/python39/lib64/python3.9/urllib/parse.py� clear_cacheasr9�ascii�strictcCs|S�Nr7)�objr7r7r8�_nooppsr>cCs |�||�Sr<��encode)r=�encoding�errorsr7r7r8�_encode_resultssrCcst��fdd�|D��S)Nc3s"|]}|r|����ndVqdS)rN��decode��.0�x�rArBr7r8� y�z_decode_args..)�tuple)�argsrArBr7rIr8� _decode_argswsrNcGsVt|dt�}|dd�D]}|rt|t�|krtd��q|rH|tfSt|�tfS)Nr�z$Cannot mix str and non-str arguments)� isinstance�str� TypeErrorr>rNrC)rMZ str_input�argr7r7r8� _coerce_args{s  rTc@seZdZdZdZddd�ZdS) �_ResultMixinStrz>Standard approach to encoding parsed results from str to bytesr7r:r;cs|j��fdd�|D��S)Nc3s|]}|����VqdSr<r?rFrIr7r8rJ�rKz)_ResultMixinStr.encode..)�_encoded_counterpart��selfrArBr7rIr8r@�sz_ResultMixinStr.encodeN)r:r;)�__name__� __module__� __qualname__�__doc__� __slots__r@r7r7r7r8rU�srUc@seZdZdZdZddd�ZdS) �_ResultMixinBytesz>Standard approach to decoding parsed results from bytes to strr7r:r;cs|j��fdd�|D��S)Nc3s|]}|����VqdSr<rDrFrIr7r8rJ�rKz+_ResultMixinBytes.decode..)�_decoded_counterpartrWr7rIr8rE�sz_ResultMixinBytes.decodeN)r:r;)rYrZr[r\r]rEr7r7r7r8r^�sr^c@sNeZdZdZdZedd��Zedd��Zedd��Zed d ��Z e e j �Z d S) �_NetlocResultMixinBasezHShared methods for the parsed result objects containing a netloc elementr7cCs |jdS)Nr�� _userinfo�rXr7r7r8�username�sz_NetlocResultMixinBase.usernamecCs |jdS)NrOrarcr7r7r8�password�sz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|t�r dnd}|�|�\}}}|��||S)Nr�%�%)� _hostinforPrQ� partition�lower)rX�hostname� separatorZpercentZzoner7r7r8rk�s  z_NetlocResultMixinBase.hostnamecCsj|jd}|durfzt|d�}Wn&tyFd|��}t|�d�Yn0d|kr\dksfntd��|S)NrO� z+Port could not be cast to integer value as ri��zPort out of range 0-65535)rh�int� ValueError)rX�port�messager7r7r8rp�s   z_NetlocResultMixinBase.portN)rYrZr[r\r]�propertyrdrerkrp� classmethod�types� GenericAlias�__class_getitem__r7r7r7r8r`�s    r`c@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinStrr7cCsD|j}|�d�\}}}|r4|�d�\}}}|s:///;?# The result is a named 6-tuple with fields corresponding to the above. It is either a ParseResult or ParseResultBytes object, depending on the type of the url parameter. The username, password, hostname, and port sub-components of netloc can also be accessed as attributes of the returned object. The scheme argument provides the default value of the scheme component when no scheme is found in url. If allow_fragments is False, no attempt is made to separate the fragment component from the previous component, which can be either path or query. Note that % escapes are not expanded. �;r)rTr� uses_params� _splitparamsr) r��scheme�allow_fragments�_coerce_resultZ splitresultr{�queryr��params�resultr7r7r8r}s rcCsRd|vr,|�d|�d��}|dkr6|dfSn |�d�}|d|�||dd�fS)N�/r�rrrO)�find�rfind)r��ir7r7r8r��s   r�cCsHt|�}dD]"}|�||�}|dkr t||�}q |||�||d�fS)Nz/?#r)�lenr��min)r��start�delim�cZwdelimr7r7r8� _splitnetloc�s   r�cCs�|r |��rdSddl}|�dd�}|�dd�}|�dd�}|�dd�}|�d|�}||kr`dSdD] }||vrdtd |d d ��qddS) Nrrxrryr��?ZNFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)�isascii� unicodedata�replaceZ normalizero)r{r��nZnetloc2r�r7r7r8� _checknetloc�s       �r�cCsr|�d�d}|�d�\}}}|rV|r.td��|�d�\}}}|rf|�d�sftd��n|�d�\}}}t|�dS)Nrx�r�Invalid IPv6 URLr�ry)r|riro� startswith�_check_bracketed_host)r{Zhostname_and_portZbefore_bracketr�r�rkr�rpr7r7r8�_check_bracketed_netloc�s r�cCsB|�d�r t�d|�s>td��nt�|�}t|tj�r>td��dS)N�vz\Av[a-fA-F0-9]+\..+\ZzIPvFuture address is invalidz%An IPv4 address cannot be in brackets)r��re�matchro� ipaddressZ ip_addressrPZ IPv4Address)rkZipr7r7r8r��s      r�c Cs�t||�\}}}|�t�}|�t�}tD]}|�|d�}|�|d�}q(t|�}|||t|�t|�f}t� |d�}|r|||�St t�t kr�t �d}}} |� d�} | dkr�|d| �D]} | tvr�q�q�|d| ���|| dd�}}|dd�dk�rXt|d�\}}d|v�r d |v�s4d |v�r:///?# The result is a named 5-tuple with fields corresponding to the above. It is either a SplitResult or SplitResultBytes object, depending on the type of the url parameter. The username, password, hostname, and port sub-components of netloc can also be accessed as attributes of the returned object. The scheme argument provides the default value of the scheme component when no scheme is found in url. If allow_fragments is False, no attempt is made to separate the fragment component from the previous component, which can be either path or query. Note that % escapes are not expanded. rNryrrOr��//rr�r�r�r�)rT�lstrip�_WHATWG_C0_CONTROL_OR_SPACE�strip�_UNSAFE_URL_BYTES_TO_REMOVEr��bool�typer4�getr��MAX_CACHE_SIZEr9r�� scheme_charsrjr�ror��splitr�r) r�r�r�r��b�key�cachedr{r�r�r�r�r�r7r7r8r�sL       "�� rcCs<t|�\}}}}}}}|r&d||f}|t|||||f��S)z�Put a parsed URL back together again. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).z%s;%s)rTr)� componentsr�r{r�r�r�r�r�r7r7r8rs � rcCs�t|�\}}}}}}|s4|r$|tvs4|dd�dkr`|rP|dd�dkrPd|}d|pXd|}|rp|d|}|r�|d|}|r�|d |}||�S) akCombine the elements of a tuple as returned by urlsplit() into a complete URL as a string. The data argument can be any five-item iterable. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had unnecessary delimiters (for example, a ? with an empty query; the RFC states that these are equivalent).Nr�r�rOr�rryr�r�)rT� uses_netloc)r�r�r{r�r�r�r�r7r7r8r#s�    rc Cs�|s|S|s|St||�\}}}t|d|�\}}}}}} t|||�\} } } } }}| |ks`| tvrh||�S| tvr�| r�|t| | | | ||f��S|} | s�| s�|} |} |s�|}|t| | | | ||f��S|�d�}|ddkr�|d=| dd�dkr�| �d�}n(|| �d�}td|dd��|dd�<g}|D]N}|dk�rZz |��Wnt�yVYn0n|dk�rj�q(n |� |��q(|ddv�r�|� d�|t| | d� |��p�d| ||f��S) zaJoin a base URL and a possibly relative URL to form an absolute interpretation of the latter.rr������NrO�..�.)r�r�) rTr� uses_relativer�rr��filter�pop� IndexError�append�join)�baser�r�r�ZbschemeZbnetlocZbpathZbparamsZbqueryZ bfragmentr�r{�pathr�r�r�Z base_partsZsegmentsZ resolved_pathZsegr7r7r8r6sb � � � �        ��rc CsTt|�\}}d|vr>t|�\}}}}}}t|||||df�}nd}|}|t||��S)z�Removes any existing fragment from URL. Returns a tuple of the defragmented URL and the fragment. If the URL contained no fragments, the second element is the empty string. r�r)rTrrr) r�r��sr��p�a�qZfragZdefragr7r7r8r{s rZ0123456789ABCDEFabcdefc Cs�|s|jdSt|t�r"|�d�}|�d�}t|�dkr<|S|dg}|j}tdurbdd�tD�a|dd�D]P}z(|t|dd ��||d d��Wqnty�|d�||�Yqn0qnd� |�S) z,unquote_to_bytes('abc%20def') -> b'abc def'.rK�utf-8rgrOrNcSs.i|]&}tD]}||��t�||��q qSr7)�_hexdigr@�bytes�fromhex)rGr�r�r7r7r8� �s �z$unquote_to_bytes..r�) r�rPrQr@r�r�� _hextobyter��KeyErrorr�)�string�bits�resr��itemr7r7r8r�s,     � rz([-]+)r�r�cCs�t|t�rt|��||�Sd|vr,|j|S|dur8d}|durDd}t�|�}|dg}|j}tdt|�d�D],}|t||��||��|||d�qnd� |�S) a�Replace %xx escapes by their single-character equivalent. The optional encoding and errors parameters specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. By default, percent-encoded sequences are decoded with UTF-8, and invalid sequences are replaced by a placeholder character. unquote('abc%20def') -> 'abc def'. rfNr�r�rrOr�r) rPr�rrEr��_asciirer��ranger�r�)r�rArBr�r�r�r�r7r7r8r�s   rF�&c CsNi}t|||||||d�}|D]*\} } | |vr>|| �| �q| g|| <q|S)aXParse a query given as a string argument. Arguments: qs: percent-encoded query string to be parsed keep_blank_values: flag indicating whether blank values in percent-encoded queries should be treated as blank strings. A true value indicates that blanks should be retained as blank strings. The default false value indicates that blank values are to be ignored and treated as if they were not included. strict_parsing: flag indicating what to do with parsing errors. If false (the default), errors are silently ignored. If true, errors raise a ValueError exception. encoding and errors: specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. max_num_fields: int. If set, then throws a ValueError if there are more than n fields read by parse_qsl(). separator: str. The symbol to use for separating the query arguments. Defaults to &. Returns a dictionary. )rArB�max_num_fieldsrl)r r�) �qs�keep_blank_values�strict_parsingrArBr�rlZ parsed_result�pairs�name�valuer7r7r8r �s�  r cCs.t|�\}}t|�\}}|r*t|ttf�s2td��|durXd|�|�} || krXtd��dd�|�|�D�} g} | D]�} | s�|s�qt| �dd�} t| �dkr�|r�td | f��|rt| �d �nqtt| d�s�|rt| d � d d �}t |||d�}||�}| d� d d �}t |||d�}||�}| �||f�qt| S)aXParse a query given as a string argument. Arguments: qs: percent-encoded query string to be parsed keep_blank_values: flag indicating whether blank values in percent-encoded queries should be treated as blank strings. A true value indicates that blanks should be retained as blank strings. The default false value indicates that blank values are to be ignored and treated as if they were not included. strict_parsing: flag indicating what to do with parsing errors. If false (the default), errors are silently ignored. If true, errors raise a ValueError exception. encoding and errors: specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. max_num_fields: int. If set, then throws a ValueError if there are more than n fields read by parse_qsl(). separator: str. The symbol to use for separating the query arguments. Defaults to &. Returns a list, as G-d intended. z*Separator must be of type string or bytes.NrOzMax number of fields exceededcSsg|]}|�qSr7r7)rG�s1r7r7r8� rKzparse_qsl..�=r�zbad query field: %rrr�+� rI) rTrPrQr�ro�countr�r�r�r�r)r�r�r�rArBr�rlr�r�� num_fieldsr��rZ name_valueZnvr�r�r7r7r8r �s:     r cCs|�dd�}t|||�S)z�Like unquote(), but also replace plus signs by spaces, as required for unquoting HTML form values. unquote_plus('%7e/abc+def') -> '~/abc def' r�r�)r�r)r�rArBr7r7r8r7s rsBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s(eZdZdZdd�Zdd�Zdd�ZdS) �Quoterz�A mapping from bytes (in range(0,256)) to strings. String values are percent-encoded byte values, unless the key < 128, and in the "safe" set (either the specified safe set, or default set). cCst�|�|_dS)zsafe: bytes object.N)� _ALWAYS_SAFE�union�safe)rXr�r7r7r8�__init__OszQuoter.__init__cCsd|jjt|�fS)Nz<%s %r>)� __class__rY�dictrcr7r7r8�__repr__SszQuoter.__repr__cCs(||jvrt|�nd�|�}|||<|S)Nz%{:02X})r��chr�format)rXr�r�r7r7r8� __missing__WszQuoter.__missing__N)rYrZr[r\r�r�r�r7r7r7r8r�Gsr�r�cCsbt|t�r8|s|S|durd}|dur*d}|�||�}n |durHtd��|durXtd��t||�S)a�quote('abc def') -> 'abc%20def' Each part of a URL, e.g. the path info, the query, etc., has a different set of reserved characters that must be quoted. The quote function offers a cautious (not minimal) way to quote a string for most of these parts. RFC 3986 Uniform Resource Identifier (URI): Generic Syntax lists the following (un)reserved characters. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" reserved = gen-delims / sub-delims gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" Each of the reserved characters is reserved in some component of a URL, but not necessarily in all of them. The quote function %-escapes all characters that are neither in the unreserved chars ("always safe") nor the additional chars set via the safe arg. The default for the safe arg is '/'. The character is reserved, but in typical usage the quote function is being called on a path where the existing slash characters are to be preserved. Python 3.7 updates from using RFC 2396 to RFC 3986 to quote URL strings. Now, "~" is included in the set of unreserved characters. string and safe may be either str or bytes objects. encoding and errors must not be specified if string is a bytes object. The optional encoding and errors parameters specify how to deal with non-ASCII characters, as accepted by the str.encode method. By default, encoding='utf-8' (characters are encoded with UTF-8), and errors='strict' (unsupported characters raise a UnicodeEncodeError). Nr�r;z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)rPrQr@rRr )r�r�rArBr7r7r8r ]s' r cCsdt|t�rd|vs$t|t�r2d|vr2t||||�St|t�rBd}nd}t|||||�}|�dd�S)z�Like quote(), but also replace ' ' with '+', as required for quoting HTML form values. Plus signs in the original string are escaped unless they are included in safe. It also does not have safe default to '/'. r�� r�)rPrQr�r r�)r�r�rArBZspacer7r7r8r �s�� r cs�t|ttf�std��|sdSt|t�r6|�dd�}ntdd�|D��}|�t|�s^|��Sz t |�Wn$t y�t |�j t |<�Yn0d� �fdd�|D��S)z�Like quote(), but accepts a bytes object rather than a str, and does not perform string-to-bytes encoding. It always returns an ASCII string. quote_from_bytes(b'abc def?') -> 'abc%20def%3f' z!quote_from_bytes() expected bytesrr:�ignorecSsg|]}|dkr|�qS)�r7)rGr�r7r7r8r��rKz$quote_from_bytes..csg|] }�|��qSr7r7)rG�char�Zquoterr7r8r��rK)rPr�� bytearrayrRrQr@�rstrip�_ALWAYS_SAFE_BYTESrEr6r�r�� __getitem__r�)Zbsr�r7rr8r �s   r c Cst|d�r|��}nNzt|�r0t|dt�s0t�Wn.ty`t��\}}}td��|��Yn0g} |s�|D]j\} } t| t �r�|| |�} n|t | �|||�} t| t �r�|| |�} n|t | �|||�} | � | d| �qn�n |D�]\} } t| t ��r|| |�} n|t | �|||�} t| t ��r@|| |�} | � | d| �q�t| t ��rn|| |||�} | � | d| �q�z t| �} Wn8t�y�|t | �|||�} | � | d| �Yq�0| D]B} t| t ��r�|| |�} n|t | �|||�} | � | d| ��q�q�d� | �S)a^Encode a dict or sequence of two-element tuples into a URL query string. If any values in the query arg are sequences and doseq is true, each sequence element is converted to a separate parameter. If the query arg is a sequence of two-element tuples, the order of the parameters in the output will match the order of parameters in the input. The components of a query arg may each be either a string or a bytes type. The safe, encoding, and errors parameters are passed down to the function specified by quote_via (encoding and errors only if a component is a str). �itemsrz1not a valid non-string sequence or mapping objectr�r�) �hasattrrr�rPrLrR�sys�exc_info�with_tracebackr�rQr�r�)r�Zdoseqr�rArBZ quote_viaZtyZva�tb�l�kr�rH�eltr7r7r8r�sR   �              rcCstjdtdd�t|�S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r��� stacklevel)�warnings�warn�DeprecationWarning� _to_bytes�r�r7r7r8�to_bytes s�rcCsHt|t�rDz|�d���}Wn&tyBtdt|�d��Yn0|S)zto_bytes(u"URL") --> 'URL'.�ASCIIzURL z contains non-ASCII characters)rPrQr@rE� UnicodeError�reprrr7r7r8rs   � rcCs`t|���}|dd�dkr<|dd�dkr<|dd���}|dd�dkr\|dd���}|S)z�Transform a string like '' into 'scheme://host/path'. The string is returned unchanged if it's not a wrapped URL. NrO��zURL:)rQr�rr7r7r8�unwraps   rcCstjdtdd�t|�S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)rrr� _splittyperr7r7r8� splittype,s�r!cCsDtdurt�dtj�at�|�}|r<|��\}}|��|fSd|fS)z:splittype('type:opaquestring') --> 'type', 'opaquestring'.Nz ([^/:]+):(.*))� _typeprogr��compile�DOTALLr��groupsrj)r�r�r��datar7r7r8r 4s   r cCstjdtdd�t|�S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)rrr� _splithostrr7r7r8� splithostAs�r(cCsXtdurt�dtj�at�|�}|rP|��\}}|rH|ddkrHd|}||fSd|fS)z;splithost('//host[:port]/path') --> 'host[:port]', '/path'.Nz//([^/#?]*)(.*)rr�)� _hostprogr�r#r$r�r%)r�r�Z host_portr�r7r7r8r'Is  r'cCstjdtdd�t|�S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)rrr� _splituser��hostr7r7r8� splituserXs�r-cCs |�d�\}}}|r|nd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.rxN�r|)r,�userr�r7r7r8r*_sr*cCstjdtdd�t|�S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)rrr� _splitpasswd)r/r7r7r8� splitpasswdes�r1cCs |�d�\}}}||r|ndfS)z/splitpasswd('user:passwd') -> 'user', 'passwd'.ryN�ri)r/r�Zpasswdr7r7r8r0lsr0cCstjdtdd�t|�S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)rrr� _splitportr+r7r7r8� splitportrs�r4cCsDtdurt�dtj�at�|�}|r<|��\}}|r<||fS|dfS)z*splitport('host:port') --> 'host', 'port'.Nz (.*):([0-9]*))� _portprogr�r#r$� fullmatchr%)r,r�rpr7r7r8r3{s  r3r�cCstjdtdd�t||�S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)rrr� _splitnport)r,�defportr7r7r8� splitnport�s�r9cCsR|�d�\}}}|s|}n0|rJz t|�}Wnty@d}Yn0||fS||fS)z�Split host and port, returning numeric port. Return given default port if no ':' found; defaults to -1. Return numerical port if a valid number are found after ':'. Return None if ':' but not a valid number.ryN)r|rnro)r,r8r�rpZnportr7r7r8r7�s   r7cCstjdtdd�t|�S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)rrr� _splitqueryrr7r7r8� splitquery�s�r;cCs$|�d�\}}}|r||fS|dfS)z/splitquery('/path?query') --> '/path', 'query'.r�Nr.)r�r�r�r�r7r7r8r:�sr:cCstjdtdd�t|�S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)rrr� _splittagrr7r7r8�splittag�s�r=cCs$|�d�\}}}|r||fS|dfS)z)splittag('/path#tag') --> '/path', 'tag'.r�Nr.)r�r�r��tagr7r7r8r<�sr<cCstjdtdd�t|�S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)rrr� _splitattrrr7r7r8� splitattr�s�r@cCs|�d�}|d|dd�fS)zksplitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].r�rrON)r�)r�Zwordsr7r7r8r?�s r?cCstjdtdd�t|�S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadr�r)rrr� _splitvalue)�attrr7r7r8� splitvalue�s�rCcCs |�d�\}}}||r|ndfS)z-splitvalue('attr=value') --> 'attr', 'value'.r�Nr2)rBr�r�r7r7r8rA�srA)rT)r)rT)T)r�r�)FFr�r�Nr�)FFr�r�Nr�)r�r�)r�NN)rNN)r�)r�)r�)lr\r�r rt� collectionsrr��__all__r�r�r�Znon_hierarchicalZ uses_queryZ uses_fragmentr�r�r�r�r4r9Z_implicit_encodingZ_implicit_errorsr>rCrNrT�objectrUr^r`rwr�r�Z_DefragResultBaseZ_SplitResultBaseZ_ParseResultBaser�r�r�r{r�r�r�Z ResultBaserrrrrrr�rr�r�r�r�r�rrrrrr�r�rr#r�rr r r� frozensetr�r�rr6� defaultdictr�r r r rrrrr!r"r r(r)r'r-r*r1r0r4r5r3r9r7r;r:r=r<r@r?rCrAr7r7r7r8�s�!  � � '  ��         >  E  � *� C  6  � Q