b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/urlparse.pyc
Size13.72 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed21-Apr-2026 05:07
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@s|dZddddddddgZd d
d d d
ddddddddddgZd d
d d dd
dddddddddddddddddgZd d dd
d
ddddd!d"dddgZd d d#d$ddd
dd!d"g
Zd
dd
dddd ddd!d"dg Zd d d
d d$d dddddddg
Zd%Zd&Z hZ
d'�Z d(e fd)��YZ
d*d+klZd,ed,d-�e
fd.��YZd/ed/d0�e
fd1��YZded2�Zd3�Zd4d5�Zd6�Zded7�Zd8�Zd9�Zed:�Zd;�Zd<Zed=�eD��Zd>�Zd4d4d?�Z d4d4d@�Z!dAS(BsóParse (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 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. Zwinski, 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.

turlparset
urlunparseturljoint urldefragturlsplitt
urlunsplittparse_qst parse_qsltftpthttptgophertnntptimaptwaistfilethttpstshttptmmstprosperotrtsptrtsputtsftpttelnettsnewstrsynctsvnssvn+sshtnfstgitsgit+sshthdltsiptsipstmailtotnewssAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.icCsti�dS(sClear the parse cache.N(t _parse_cachetclear(((s /usr/lib64/python2.6/urlparse.pyt clear_cache>st ResultMixincBsJeZdZed��Zed��Zed��Zed��ZRS(s-Shared methods for the parsed result objects.cCs\|i}d|joB|idd�d}d|jo|idd�d}n|SdS(Nt@iit:(tnetloctrsplittsplittNone(tselfR(tuserinfo((s /usr/lib64/python2.6/urlparse.pytusernameFs 

cCsV|i}d|jo<|idd�d}d|jo|idd�dSndS(NR&iiR'(R(R)R*R+(R,R(R-((s /usr/lib64/python2.6/urlparse.pytpasswordPs  

cCsh|i}d|jo|idd�d}nd|jo|idd�d}n|i�pdS(NR&iR'i(R(R)R*tlowerR+(R,R(((s /usr/lib64/python2.6/urlparse.pythostnameYs  

cCse|i}d|jo|idd�d}nd|jo$|idd�d}t|d�SdS(NR&iR'i
(R(R)R*tintR+(R,R(tport((s /usr/lib64/python2.6/urlparse.pyR3bs 

(t__name__t
__module__t__doc__tpropertyR.R/R1R3(((s /usr/lib64/python2.6/urlparse.pyR%Cs

  iÿÿÿÿ(t
namedtuplet SplitResults!scheme netloc path query fragmentcBseZdZd�ZRS(cCs
t|�S(N(R(R,((s /usr/lib64/python2.6/urlparse.pytgeturlrs((R4R5t __slots__R:(((s /usr/lib64/python2.6/urlparse.pyR9nst ParseResults(scheme netloc path params query fragmentcBseZdZd�ZRS(cCs
t|�S(N(R(R,((s /usr/lib64/python2.6/urlparse.pyR:zs((R4R5R;R:(((s /usr/lib64/python2.6/urlparse.pyR<vscCsvt|||�}|\}}}}}|tjo#d|jot|�\}}nd}t||||||�S(s#Parse a URL into 6 components:
<scheme>://<netloc>/<path>;<params>?<query>#<fragment>
Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) and we don't expand % escapes.t;R(Rt uses_paramst _splitparamsR<(turltschemetallow_fragmentsttupleR(tquerytfragmenttparams((s /usr/lib64/python2.6/urlparse.pyR~s cCsid|jo7|id|id��}|djo |dfSn|id�}|| ||dfS(Nt/R=iRi(tfindtrfind(R@ti((s /usr/lib64/python2.6/urlparse.pyR?�s 

icCsdt|�}x@dD]8}|i||�}|djot||�}qqW|||!||fS(Ns/?#i(tlenRHtmin(R@tstarttdelimtctwdelim((s /usr/lib64/python2.6/urlparse.pyt _splitnetloc�s 
cCsÌ| pt|t� odSddk}|idd�}|idd�}|idd�}|idd�}|id|�}||jodSx/dD]'}||jotd |��q�q�WdS(
Niÿÿÿÿu@uu:u#u?tNFKCs/?#@:s>netloc %r contains invalid characters under NFKC normalization(t
isinstancetunicodet unicodedatatreplacet normalizet
ValueError(R(RUtntnetloc2RO((s /usr/lib64/python2.6/urlparse.pyt _checknetloc�s 

c Csst|�}|||t|�t|�f}ti|d
�}|o|Stt�tjo t�nd}}}|id�}|djo-|| djoÒ|| i �}||d}|d djot
|d�\}}n|o)d|jo|i dd�\}}nd |jo|i d d�\}}nt |�t
|||||�} | t|<| SxG|| D]}
|
tjoPq�q�W|| i �||d}}n|d djot
|d�\}}n|o)d|jo|i dd�\}}nd |jo|i d d�\}}nt |�t
|||||�} | t|<| S( sParse a URL into 5 components:
<scheme>://<netloc>/<path>?<query>#<fragment>
Return a 5-tuple: (scheme, netloc, path, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) and we don't expand % escapes.RR'iR iis//t#t?N(tboolttypeR"tgetR+RKtMAX_CACHE_SIZER$RHR0RQR*R[R9t scheme_chars( R@RARBtkeytcachedR(RDRERJtvRO((s /usr/lib64/python2.6/urlparse.pyR°sL ! 



 
 #


cCsL|\}}}}}}|od||f}nt|||||f�S(sú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).s%s;%s(R(tdataRAR(R@RFRDRE((s /usr/lib64/python2.6/urlparse.pyRÞscCsÏ|\}}}}}|p%|o]|tjoP|d djo?|o|d djod|}nd|pd|}n|o|d|}n|o|d|}n|o|d|}n|S( skCombine 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).is//iRGRR'R]R\(t uses_netloc(RfRAR(R@RDRE((s /usr/lib64/python2.6/urlparse.pyRès,c
Cs¯|p|S|p|St|d|�\}}}}}}t|||�\} }
} } }
}| |jp
| tjo|S| tjo.|
ot| |
| | |
|f�S|}
n| d djot| |
| | |
|f�S| pk|} | p
|} n'| d } t| |
| | |
|f�S|
p
|}
nt| |
| | |
|f�S|id�d | id�}|ddjod|d<nxd|jo|id�q�Wxvd}t|�d}xZ||joK||djo,||dd jo||d|d5Pn|d}q×WPq¾|ddgjod|d<n6t|�djo"|ddjodg|d)nt| |
di|�| |
|f�S(
saJoin a base URL and a possibly relative URL to form an absolute
interpretation of the latter.RiRGiÿÿÿÿt.s..iiþÿÿÿ(Rs..(Rt
uses_relativeRgRR*tremoveRKtjoin(tbaseR@RBtbschemetbnetloctbpathtbparamstbqueryt bfragmentRAR(tpathRFRDREtsegmentsRJRY((s /usr/lib64/python2.6/urlparse.pyRúsd$$
 
 

 
  

$cCsbd|joGt|�\}}}}}}t|||||df�}||fS|dfSdS(s¿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\RN(RR(R@tsRYtptatqtfragtdefrag((s /usr/lib64/python2.6/urlparse.pyR3s

 t0123456789ABCDEFabcdefccsGx@|]9}x0tD](}||tt||d��fVqWqWdS(iN(t_hexdigtchrR2(t.0Rwtb((s /usr/lib64/python2.6/urlparse.pys <genexpr>Gs c Cs¿|id�}x tdt|��D]�}||}yt|d |d||<Wq%tj
od|||<q%tj
o,tt|d d��|d||<q%Xq%Wdi|�S(s"unquote('abc%20def') -> 'abc def'.t%iiiR( R*txrangeRKt _hextochrtKeyErrortUnicodeDecodeErrortunichrR2Rk(RutresRJtitem((s /usr/lib64/python2.6/urlparse.pytunquoteIs
.cCs\h}xOt|||�D];\}}||jo||i|�q|g||<qW|S(sªParse a query given as a string argument.

Arguments:

qs: URL-encoded query string to be parsed

keep_blank_values: flag indicating whether blank values in
URL 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.
(Rtappend(tqstkeep_blank_valueststrict_parsingtdicttnametvalue((s /usr/lib64/python2.6/urlparse.pyRVs 
c Cs8g}|id�D]#}|id�D]
}||q'q~}g}xë|D]ã}| o| oqMn|idd�} t| �djo:|otd|f�n|o| id�qÉqMnt| d�p|oOt| did d
��}
t| did d
��} |i|
| f�qMqMW|S( s�Parse a query given as a string argument.

Arguments:

qs: URL-encoded query string to be parsed

keep_blank_values: flag indicating whether blank values in
URL 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.

Returns a list, as G-d intended.
t&R=t=iisbad query field: %rRit+t (R*RKRXR�R�RV( R�R�R�t_[1]ts1ts2tpairstrt
name_valuetnvR�R�((s /usr/lib64/python2.6/urlparse.pyRps$@N("R6t__all__RiRgR>tnon_hierarchicalt
uses_queryt
uses_fragmentRbRaR"R$tobjectR%t collectionsR8R9R<tTrueRR?RQR[RRRRRR|R�R�R�RR(((s /usr/lib64/python2.6/urlparse.pyt<module>sR   )""  .
 9