PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /lib64/python2.7/test/
Server: Linux apophis.o2switch.net 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
IP: 109.234.164.184
Choose File :

Url:
Dir : //lib64/python2.7/test/test_urlparse.pyo

�
zfc@skddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlZddlZddl
ZddlZdZdZdZdZdgfd	gfd
gfdddfgfddd
fgfd
d
dfgfdd
dfgfdd
dfgfdd
dfgfdd
dfddfgfdd
dfd
dfgfgZdgfdgfdd
dfgfdd
dfddfgfdd
dfd
dfgfgZdd
dfd
dfd
dfgfdd
dfddfddfgfd d
dfddfddfgfgZdd!dfgfdd
d"fgfdd!dfgfdd
d"fgfdd
d#fd
dfgfdd
d#fd
dfgfgZdifd	ifd
ifdidgd6fdid
gd6fd
idgd
6fdidgd
6fdidgd
6fdidgd
6dgd6fdiddgd
6fdifd	ifd
ifdidgd6fdid
gd6fd
idgd
6fdidgd
6fdidgd
6fdidgd
6dgd6fdiddgd
6fgZdifdifdidgd
6fdidgd
6dgd6fdiddgd
6fdifdifdidgd
6fdidgd
6dgd6fdiddgd
6fg
Zdidddgd
6fdidgd
6dgd6dgd6fd idgd
6dgd6dgd6fdidddgd
6fdidgd
6dgd6dgd6fd idgd
6dgd6dgd6fgZdidgd!6fdid"gd
6fdidgd!6fdid"gd
6fdid#dgd
6fdid#dgd
6fgZd$ejfd%��YZd&�Zed'krge�ndS((i����(ttest_supportN(tEnvironmentVarGuard(tcatch_warningstfilterwarningsshttp://a/b/c/d;p?q#fshttp://a/b/c/d;p?qshttp://a/b/c/dtt&s&&t=s=atasa=s&a=btbsa=a+b&b=b+csa bsb csa=1&a=2t1t2t;s;;s;a=bsa=a+b;b=b+csa=1;a=2sa=1;a=2&a=3t3sa=1;b=2&c=3tcsa=1&b=2&c=3;s;as	a b;b=b cs1;a=2tUrlParseTestCasecBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z e!j"d��Z#d �Z$d!�Z%d"�Z&d#�Z'd$�Z(d%�Z)d&�Z*d'�Z+d(�Z,RS()cCs>tj|�}|j||�|j|j|j|j|j|jf}|j||�tj|�}|j||�|j||j	��tj|j	��}|j|j	�|j	��|j||�|j|j|j�|j|j|j�|j|j|j�|j|j|j�|j|j|j�|j|j|j�|j|j
|j
�|j|j|j�|j|j|j�|j|j
|j
�tj|�}|j||�|j|j|j|j|jf}|j||�tj|�}|j||�|j||j	��tj|j	��}|j|j	�|j	��|j||�|j|j|j�|j|j|j�|j|j|j�|j|j|j�|j|j|j�|j|j
|j
�|j|j|j�|j|j|j�|j|j
|j
�dS(N(turlparsetassertEqualtschemetnetloctpathtparamstquerytfragmentt
urlunparsetgeturltusernametpasswordthostnametportturlsplitt
urlunsplit(tselfturltparsedtsplittresulttttresult2tresult3((s*/usr/lib64/python2.7/test/test_urlparse.pytcheckRoundtripsrsRcCs�x�tD]�\}}tj|dt�}|j||d|�g|D]}t|d�rF|^qF}tj|dt�}|j||d|�qWdS(Ntkeep_blank_valuessError parsing %ri(tparse_qsl_test_casesRt	parse_qsltTrueRtlentFalse(RtorigtexpectR#tvtexpect_without_blanks((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_qsl�s)cCs�x�tD]�\}}tj|dt�}|j||d|�tg|D]*}t||d�rI|||f^qI�}tj|dt�}|j||d|�qWdS(NR(sError parsing %ri(tparse_qs_test_casesRtparse_qsR+RtdictR,R-(RR.R/R#R0R1((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_qs�s:c
Cs�x�tD]�\}}tdt��I}tdddtj�tj|dt�}|j||d|�WdQX|jt|�d�|j|dj	tj�qWdS(	NtrecordtactiontalwaystcategoryR(sError parsing %rii(
tparse_qs_test_cases_warnRR+RRt_QueryStringSeparatorWarningR4RR,R:(RR.R/twR#((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_qs_default_warn�s
c
Cs�x�tD]�\}}tdt��I}tdddtj�tj|dt�}|j||d|�WdQX|jt|�d�|j|dj	tj�qWdS(	NR7R8R9R:R(sError parsing %rii(
tparse_qsl_test_cases_warnRR+RRR<R*RR,R:(RR.R/R=R#((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_qsl_default_warn�s
c
CsuxntD]f\}}tdt��3}tj|dt�}|j||d|�WdQX|jt|�d�qWdS(NR7R(sError parsing %ri(R3RR+RR4RR,(RR.R/R=R#((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_default_qs_no_warnings�s
c
CsuxntD]f\}}tdt��3}tj|dt�}|j||d|�WdQX|jt|�d�qWdS(NR7R(sError parsing %ri(R)RR+RR*RR,(RR.R/R=R#((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_default_qsl_no_warnings�s
cCsdddfdddfd	ddfd
dd fdd!d"fdd#d$fg}x*|D]"\}}}|j|||�qUWdS(%Nsfile:///tmp/junk.txttfileRs
/tmp/junk.txtsimap://mail.python.org/mbox1timapsmail.python.orgs/mbox1s1mms://wms.sys.hinet.net/cts/Drama/09006251100.asftmmsswms.sys.hinet.nets/cts/Drama/09006251100.asfsnfs://server/path/to/file.txttnfstservers/path/to/file.txts0svn+ssh://svn.zope.org/repos/main/ZConfig/trunk/ssvn+sshssvn.zope.orgs/repos/main/ZConfig/trunk/s)git+ssh://git@github.com/user/project.gitsgit+sshsgit@github.coms/user/project.git(RCRs
/tmp/junk.txtRRR(RCRs
/tmp/junk.txtRR(RDsmail.python.orgs/mbox1RRR(RDsmail.python.orgs/mbox1RR(REswms.sys.hinet.nets/cts/Drama/09006251100.asfRRR(REswms.sys.hinet.nets/cts/Drama/09006251100.asfRR(RFRGs/path/to/file.txtRRR(RFRGs/path/to/file.txtRR(ssvn+sshssvn.zope.orgs/repos/main/ZConfig/trunk/RRR(ssvn+sshssvn.zope.orgs/repos/main/ZConfig/trunk/RR(sgit+sshsgit@github.coms/user/project.gitRRR(sgit+sshsgit@github.coms/user/project.gitRR(R'(Rt	testcasesR R!R"((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_roundtrips�s4c
Cs�dddfdddfdddfdddfd
ddfg}x_dD]W}xN|D]F\}}}||}|f|}|f|}|j|||�qVWqIWdS(Ns://www.python.orgswww.python.orgRs://www.python.org#abctabcs://www.python.org?q=abcsq=abcs://www.python.org/#abct/s://a/b/c/d;p?q#fRs/b/c/dtptqtfs/b/c/d;pthttpthttps(swww.python.orgRRRR(swww.python.orgRRR(swww.python.orgRRRRJ(swww.python.orgRRRJ(swww.python.orgRRsq=abcR(swww.python.orgRsq=abcR(swww.python.orgRKRRRJ(swww.python.orgRKRRJ(Rs/b/c/dRLRMRN(Rs/b/c/d;pRMRN(RORP(R'(RRHRR R!R"((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_http_roundtrips�s*



cCs,|jtj||�||||f�dS(N(RRturljoin(Rtbasetrelurltexpected((s*/usr/lib64/python2.7/test/test_urlparse.pyt	checkJoinscCsnxgdddddddgD]J}|jtjtj|��|�|jtjtj|��|�qWdS(NtPythons./Pythonsx-newscheme://foo.com/stuffsx://ysx:/ysx:/RK(RRRRR(Rtu((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_unparse_parses""cCs�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtd	d
�|jtdd�|jtd
d�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtd d�|jtd!d"�|jtd#d$�|jtd%d$�|jtd&d�|jtd'd(�|jtd)d*�|jtd+d,�|jtd-d.�|jtd/d*�|jtd0d1�|jtd2d3�|jtd4d5�|jtd6d7�|jtd8d"�|jtd9d�|jtd:d;�|jtd<d=�dS(>Nsg:htgshttp://a/b/c/gs./gsg/shttp://a/b/c/g/s/gs
http://a/gs//gshttp://gsg?yshttp://a/b/c/g?ysg?y/./xshttp://a/b/c/g?y/./xs#sshttp://a/b/c/d;p?q#ssg#sshttp://a/b/c/g#ssg#s/./xshttp://a/b/c/g#s/./xsg?y#sshttp://a/b/c/g?y#ssg;xshttp://a/b/c/g;xsg;x?y#sshttp://a/b/c/g;x?y#st.s
http://a/b/c/s./s..shttp://a/b/s../s../gshttp://a/b/gs../..s	http://a/s../../s../../gRshttp://a/b/c/d;p?q#fs
../../../gs
http://a/../gs
../../../../gshttp://a/../../gs/./gshttp://a/./gs/../gsg.shttp://a/b/c/g.s.gshttp://a/b/c/.gsg..shttp://a/b/c/g..s..gshttp://a/b/c/..gs./../gs./g/.sg/./hshttp://a/b/c/g/hsg/../hshttp://a/b/c/h(RVtRFC1808_BASE(R((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_RFC1808sFcCs|jtjd�d�dS(Nsmailto:1337@example.orgtmailtoRs1337@example.org(R^Rs1337@example.orgRRR(RR(R((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_RFC2368JscCs�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtd	d
�|jtdd�|jtd
d�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd �|jtd!d �|jtd"d�|jtd#t�|jtd$d%�|jtd&d'�|jtd(d)�|jtd*d%�|jtd+d,�|jtd-d.�|jtd/d0�|jtd1d2�|jtd3d�|jtd4d�|jtd5d6�|jtd7d8�|jtd9d:�|jtd;d<�|jtd=d>�|jtd?d@�|jtdAdB�|jtdCdD�dS(ENsg:hRZshttp://a/b/c/gs./gsg/shttp://a/b/c/g/s/gs
http://a/gs//gshttp://gsg?yshttp://a/b/c/g?ys#sshttp://a/b/c/d;p?q#ssg#sshttp://a/b/c/g#ssg?y#sshttp://a/b/c/g?y#ssg;xshttp://a/b/c/g;xsg;x?y#sshttp://a/b/c/g;x?y#sR[s
http://a/b/c/s./s..shttp://a/b/s../s../gshttp://a/b/gs../..s	http://a/s../../s../../gRs
../../../gs
http://a/../gs
../../../../gshttp://a/../../gs/./gshttp://a/./gs/../gsg.shttp://a/b/c/g.s.gshttp://a/b/c/.gsg..shttp://a/b/c/g..s..gshttp://a/b/c/..gs./../gs./g/.sg/./hshttp://a/b/c/g/hsg/../hshttp://a/b/c/hs	g;x=1/./yshttp://a/b/c/g;x=1/ys
g;x=1/../yshttp://a/b/c/ysg?y/./xshttp://a/b/c/g?y/./xsg?y/../xshttp://a/b/c/g?y/../xsg#s/./xshttp://a/b/c/g#s/./xsg#s/../xshttp://a/b/c/g#s/../x(RVtRFC2396_BASE(R((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_RFC2396OsNcCs|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtd	d
�|jtdd�|jtd
d�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtd d!�|jtd"d!�|jtd#d$�|jtd%d&�|jtd'd&�|jtd(d�|jtd)d*�|jtd+d,�|jtd-d.�|jtd/d0�|jtd1d$�|jtd2d
�|jtd3d4�|jtd5d6�|jtd7d8�|jtd9d:�|jtd;d<�|jtd=d>�|jtd?d@�|jtdAdB�|jtdCd�|jdDdd�dS(ENs?yshttp://a/b/c/d;p?ys;xshttp://a/b/c/;xsg:hRZshttp://a/b/c/gs./gsg/shttp://a/b/c/g/s/gs
http://a/gs//gshttp://gsg?yshttp://a/b/c/g?ys#sshttp://a/b/c/d;p?q#ssg#sshttp://a/b/c/g#ssg?y#sshttp://a/b/c/g?y#ssg;xshttp://a/b/c/g;xsg;x?y#sshttp://a/b/c/g;x?y#sRshttp://a/b/c/d;p?qR[s
http://a/b/c/s./s..shttp://a/b/s../s../gshttp://a/b/gs../..s	http://a/s../../s../../gsg.shttp://a/b/c/g.s.gshttp://a/b/c/.gsg..shttp://a/b/c/g..s..gshttp://a/b/c/..gs./../gs./g/.sg/./hshttp://a/b/c/g/hsg/../hshttp://a/b/c/hs	g;x=1/./yshttp://a/b/c/g;x=1/ys
g;x=1/../yshttp://a/b/c/ysg?y/./xshttp://a/b/c/g?y/./xsg?y/../xshttp://a/b/c/g?y/../xsg#s/./xshttp://a/b/c/g#s/./xsg#s/../xshttp://a/b/c/g#s/../xshttp:gshttp://a/b/c/de(RVtRFC3986_BASER`(R((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_RFC3986ysRcCs�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd	�|jtd
d�|jtdd
�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd�|jtdd �|jtd!d�|jtd"d	�|jtd#d$�|jtd%d&�|jtd'd(�|jtdd�|jtdd�|jtd)d�|jtd*d�|jtd+d�|jd,dd,�|jd-dd�|jd-d$d$�|jd.d/d0�|jd1d/d2�dS(3Nsg:hshttp:gshttp://a/b/c/gshttp:shttp://a/b/c/dRZs./gsg/shttp://a/b/c/g/s/gs
http://a/gs//gshttp://gs?yshttp://a/b/c/d?ysg?yshttp://a/b/c/g?ysg?y/./xshttp://a/b/c/g?y/./xR[s
http://a/b/c/s./s..shttp://a/b/s../s../gshttp://a/b/gs../..s	http://a/s../../gs
../../../gs
http://a/../gs./../gs./g/.s/./gshttp://a/./gsg/./hshttp://a/b/c/g/hsg/../hshttp://a/b/c/hshttp:?yshttp:g?yshttp:g?y/./xshttp:///Rssvn://pathtorepo/dir1tdir2ssvn://pathtorepo/dir2ssvn+ssh://pathtorepo/dir1ssvn+ssh://pathtorepo/dir2(RVtSIMPLE_BASE(R((s*/usr/lib64/python2.7/test/test_urlparse.pyt
test_urljoins�sDcCs�x�d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>gD]@\}}}tj|�}|j|j|jf||f�qOWx3d"d#d$d%d&gD]}|jttj|�q�WdS(?Ns http://Test.python.org:5432/foo/stest.python.orgi8shttp://12.34.56.78:5432/foo/s12.34.56.78shttp://[::1]:5432/foo/s::1shttp://[dead:beef::1]:5432/foo/sdead:beef::1shttp://[dead:beef::]:5432/foo/sdead:beef::s:http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:5432/foo/s'dead:beef:cafe:5417:affe:8fa3:deaf:feeds http://[::12.34.56.78]:5432/foo/s
::12.34.56.78s%http://[::ffff:12.34.56.78]:5432/foo/s::ffff:12.34.56.78shttp://Test.python.org/foo/shttp://12.34.56.78/foo/shttp://[::1]/foo/shttp://[dead:beef::1]/foo/shttp://[dead:beef::]/foo/s5http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/shttp://[::12.34.56.78]/foo/s http://[::ffff:12.34.56.78]/foo/shttp://Test.python.org:/foo/shttp://12.34.56.78:/foo/shttp://[::1]:/foo/shttp://[dead:beef::1]:/foo/shttp://[dead:beef::]:/foo/s6http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:/foo/shttp://[::12.34.56.78]:/foo/s!http://[::ffff:12.34.56.78]:/foo/shttp://::12.34.56.78]/shttp://[::1/foo/sftp://[::1/foo/bad]/badshttp://[::1/foo/bad]/badshttp://[::ffff:12.34.56.78(s http://Test.python.org:5432/foo/stest.python.orgi8(shttp://12.34.56.78:5432/foo/s12.34.56.78i8(shttp://[::1]:5432/foo/s::1i8(shttp://[dead:beef::1]:5432/foo/sdead:beef::1i8(shttp://[dead:beef::]:5432/foo/sdead:beef::i8(s:http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:5432/foo/s'dead:beef:cafe:5417:affe:8fa3:deaf:feedi8(s http://[::12.34.56.78]:5432/foo/s
::12.34.56.78i8(s%http://[::ffff:12.34.56.78]:5432/foo/s::ffff:12.34.56.78i8(shttp://Test.python.org/foo/stest.python.orgN(shttp://12.34.56.78/foo/s12.34.56.78N(shttp://[::1]/foo/s::1N(shttp://[dead:beef::1]/foo/sdead:beef::1N(shttp://[dead:beef::]/foo/sdead:beef::N(s5http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/s'dead:beef:cafe:5417:affe:8fa3:deaf:feedN(shttp://[::12.34.56.78]/foo/s
::12.34.56.78N(s http://[::ffff:12.34.56.78]/foo/s::ffff:12.34.56.78N(shttp://Test.python.org:/foo/stest.python.orgN(shttp://12.34.56.78:/foo/s12.34.56.78N(shttp://[::1]:/foo/s::1N(shttp://[dead:beef::1]:/foo/sdead:beef::1N(shttp://[dead:beef::]:/foo/sdead:beef::N(s6http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:/foo/s'dead:beef:cafe:5417:affe:8fa3:deaf:feedN(shttp://[::12.34.56.78]:/foo/s
::12.34.56.78N(s!http://[::ffff:12.34.56.78]:/foo/s::ffff:12.34.56.78N(tNoneRRRRtassertRaisest
ValueError(RR RRt	urlparsedtinvalid_url((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_RFC2732�sP&
cCsmxfddddddddtdd
ftddfg
D].\}}}|jtj|�||f�q7WdS(Nshttp://python.org#fragshttp://python.orgtfragRshttp://python.org/#fragshttp://python.org/shttp://python.org/?q#fragshttp://python.org/?qshttp://python.org/p#fragshttp://python.org/pshttp://python.org/p?qshttp://a/b/c/d;p?qRN(shttp://python.org#fragshttp://python.orgRm(shttp://python.orgshttp://python.orgR(shttp://python.org/#fragshttp://python.org/Rm(shttp://python.org/shttp://python.org/R(shttp://python.org/?q#fragshttp://python.org/?qRm(shttp://python.org/?qshttp://python.org/?qR(shttp://python.org/p#fragshttp://python.org/pRm(shttp://python.org/p?qshttp://python.org/p?qR(R\R`RRt	urldefrag(RR tdefragRm((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_urldefragscCs�d}tj|�}|j|jd�|j|jd�|j|jd�|j|jd�|j|jd�|j|jd�|j|j
d�|j|jd�|j|jd�d}tj|�}|j|jd�|j|jd	�|j|jd�|j|jd
�|j|jd�|j|jd�|j|j
d�|j|jd�|j|jd
�|j|j
�|�d}tj|�}|j|jd�|j|jd�|j|jd�|j|jd
�|j|jd�|j|jd�|j|j
d�|j|jd�|j|jd
�|j|j
�|�d}tj|�}|j|jd�dS(NsHTTP://WWW.PYTHON.ORG/doc/#fragROsWWW.PYTHON.ORGs/doc/RRmswww.python.orgs7http://User:Pass@www.python.org:080/doc/?query=yes#fragsUser:Pass@www.python.org:080s	query=yestUsertPassiPsChttp://User@example.com:Pass@www.python.org:080/doc/?query=yes#frags(User@example.com:Pass@www.python.org:080sUser@example.comshttp://www.python.org:65536(RRRRRRRRRRgRRRR(RR RL((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_urlsplit_attributessLcCs�tjd�}|j|jd�|j|jd�tjd�}|j|jd�|j|jd�tjd�}|j|jd�|j|jd�tjd�}|j|jd�|j|jd�dS(Nstel:+31-641044153ttels
+31-641044153stel:+31641044153s+31641044153(RRRRR(Rtp1tp2((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_issue14072EscCs$tjd�}|j|jd�|j|jd�|j|jd�tjd�}|j|jd�|j|jd�|j|jd�tjd�}|j|jd�|j|jd	�|j|jd
�tjd�}|j|jd�|j|jd�|j|jd
�dS(Ns"tel:123-4;phone-context=+1-650-516Rts123-4sphone-context=+1-650-516stel:+1-201-555-0123s+1-201-555-0123Rs"tel:7042;phone-context=example.comt7042sphone-context=example.coms%tel:863-1234;phone-context=+1-914-555s863-1234sphone-context=+1-914-555(RRRRR(RRu((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_telurl_paramsXs cCsgd}tj|�}|j|jd�|j|jd�|j|jd�|j|jd�|j|jd�|j|jd�|j|j
d�|j|jd�|j|jd�|j|j
�d�d}tj|�}|j|jd�|j|jd�|j|jd�|j|jd�|j|jd�|j|jd�|j|j
d�|j|jd�|j|jd�|j|j
�d�d}tj|�}|j|j
�d	�d}tj|�}|j|j
�d	�d
}d}xRtd�D]D}tj|d
|�}|j|jd�|j|j
�d�qWdS(NsQh
ttp://www.python
.org	/java
script:	alert('msg
')/?query
=	something#frag
mentROswww.python.orgs/javascript:alert('msg')/squery=somethingRsGhttp://www.python.org/javascript:alert('msg')/?query=something#fragmentsYx-new-scheme	://www.python
.org	/java
script:	alert('msg
')/?query
=	something#frag
mentsOx-new-scheme://www.python.org/javascript:alert('msg')/?query=something#fragmentsQhttps://www.python
.org	/java
script:	alert('msg
')/?query
=	something#frag
mentshtt
psiRRPsHhttps://www.python.org/javascript:alert('msg')/?query=something#fragment(RRRRRRRRRRgRRRRtrange(RR RLRt_((s*/usr/lib64/python2.7/test/test_urlparse.pyt!test_urlsplit_remove_unsafe_bytesmsHc	CsDdjgtdd�D]}t|�^q�}d}|jd�|}tj|�}|j|jd�|j|jd�|j|j	d	�|j|j
d
�|j|jd�|j|jd�|j|j
d
�|j|jd�|j|jd�|j|j�|�||jd�}tj|�}|j|jd�|j|jd�|j|j	d	�|j|j
d
�|j|jd�|j|jd�|j|j
d
�|j|jd�|j|jd�|j|j�|jd��d}tj|jd�|�}|j|jd�|j|jd�|j|j	d	�|j|j
d�|j|jd�|j|j�|�tjd�}|jtj|�d�d}|jd�d|jd�}xRtd�D]D}tj|d|�}|j|jd�|j|j�d�q�WdS(NRii is7http://User:Pass@www.python.org:080/doc/?query=yes#fragsutf-8ROsUser:Pass@www.python.org:080s/doc/s	query=yesRmRqRrswww.python.orgiPs)https://www.python.org:88/doc/?query=    RPswww.python.org:88s
query=    iXs
www.pypi.org s//www.python.org/iRshttps://www.python.org/i!(tjoinRztchrtdecodeRRRRRRRRRRRRRtencodeR(	Rtitnoisetbase_urlR RLtquery_spaces_urlRR{((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_urlsplit_strip_url�sT1 csztjd��|j�jd�|jt�fd��tjd��|j�jd�|jt�fd��dS(s$Check handling of non-integer ports.shttp://www.example.net:fooswww.example.net:foocs�jS(N(R((RL(s*/usr/lib64/python2.7/test/test_urlparse.pyt<lambda>�Rcs�jS(N(R((RL(s*/usr/lib64/python2.7/test/test_urlparse.pyR��RN(RRRRRhRi(R((RLs*/usr/lib64/python2.7/test/test_urlparse.pyttest_attributes_bad_port�scCsd}tj|�}|j|jd�|j|jd�|j|jd�|j|jd�|j|jd�|j|j	�|�tj|�}|j|jd�|j|jd�|j|jd�|j|jd�|j|jd�|j|j	�|�dS(Ns0sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15R(
RRRRRRgRRRR(RturiRL((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_attributes_without_netloc�scCs�d}t|�}tj|�tj|�}|jt|j�t|��|jt|j�t|��|jt|j�t|��dS(Nshttp://example.com/doc/(tunicodeRRttypeRRR(RR�tunicode_uriRL((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_caching�s
cCs|jtjd�d�dS(Ns http://example.com?blahblah=/fooROsexample.comRs
blahblah=/foo(ROsexample.comRRs
blahblah=/fooR(RR(R((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_noslashscCsh|jtjd�d�|jtjd�d
�|jtjd�d�|jtjd�d�dS(Nss3://foo.com/stuffts3sfoo.coms/stuffRsx-newscheme://foo.com/stuffsx-newschemes*x-newscheme://foo.com/stuff?query#fragmentRRs!x-newscheme://foo.com/stuff?query(R�sfoo.coms/stuffRRR(sx-newschemesfoo.coms/stuffRRR(sx-newschemesfoo.coms/stuffRRR(sx-newschemesfoo.coms/stuffRRR(RR(R((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_anyscheme	scCsO|jtjd�d�|jtjd�d�|jtjd�d	�dS(
NRRs//www.python.org:80swww.python.org:80shttp://www.python.org:80RO(RRRRRR(Rswww.python.org:80RRRR(ROswww.python.org:80RRRR(RR(R((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_withoutschemescCsh|jtjd�d	�|jtjd�d
�|jtjd�d�|jtjd�d�dS(
Nspath:80Rshttp:ROshttps:RPshttp://www.python.org:80swww.python.org:80(RRspath:80RRR(RORRRRR(RPRRRRR(ROswww.python.org:80RRRR(RR(R((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_portseparator scCs�idgd6dgd6}tjddd�}|j||�tjddd�}|j||�tjddd�}|j|idgd6dgd6�dS(NR	RR
Rsa=1;b=2t	separatorR(RR4R(RRUR#((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_parse_qs_separator_bytes)sccs�tj}dt_zntj�}tjj|d�}t	|d��*}|j
d�|j
dj|��WdQX|t_dVWd|t_dt_tj
|�XdS(sKContext for the given parse_qsl default separator configured in config filesconf.cfgR=s[parse_qs]
sPYTHON_URLLIB_QS_SEPARATOR = {}N(Rt_QS_SEPARATOR_CONFIG_FILENAMERgt_default_qs_separatorttempfiletmkdtemptosRR}topentwritetformattshutiltrmtree(Rtseptold_filenamet
tmpdirnametfilenameRC((s*/usr/lib64/python2.7/test/test_urlparse.pyt_qsl_sep_config3s		
				c
Cs!xtD]\}}tj|dd�}|j||d|�t��8}tdt�� }d|d<tj|�}WdQXWdQX|j||d|�|jt|�d�|jd��,tdt��}tj|�}WdQXWdQX|j||d|�|jt|�d�qWdS(NR�RsError parsing %rR7tPYTHON_URLLIB_QS_SEPARATORi(	tparse_qs_test_cases_semicolonRR4RRRR+R,R�(RR.R/R#tenvironR=((s*/usr/lib64/python2.7/test/test_urlparse.pyt!test_parse_qs_separator_semicolonEs
c
Cs!xtD]\}}tj|dd�}|j||d|�t��8}tdt�� }d|d<tj|�}WdQXWdQX|j||d|�|jt|�d�|jd��,tdt��}tj|�}WdQXWdQX|j||d|�|jt|�d�qWdS(NR�RsError parsing %rR7R�i(	tparse_qsl_test_cases_semicolonRR*RRRR+R,R�(RR.R/R#R�R=((s*/usr/lib64/python2.7/test/test_urlparse.pyt"test_parse_qsl_separator_semicolonSs
c
Cs�x�tD]�\}}t��8}tdt�� }d|d<tj|�}WdQXWdQX|j||d|�|jt|�d�|jd��,tdt��}tj|�}WdQXWdQX|j||d|�|jt|�d�qWdS(NR7tlegacyR�sError parsing %ri(	tparse_qs_test_cases_legacyRRR+RR4RR,R�(RR.R/R�R=R#((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_parse_qs_separator_legacyas
c
Cs�x�tD]�\}}t��8}tdt�� }d|d<tj|�}WdQXWdQX|j||d|�|jt|�d�|jd��,tdt��}tj|�}WdQXWdQX|j||d|�|jt|�d�qWdS(NR7R�R�sError parsing %ri(	tparse_qsl_test_cases_legacyRRR+RR*RR,R�(RR.R/R�R=R#((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_parse_qsl_separator_legacyms
cCs�x�d
D]�}t��L}tdt��4}||d<|jt��tjd�WdQXWdQXWdQX|jd	��@tdt��*}|jt��tjd�WdQXWdQXWdQXqWdS(NRRJtsafes&;tSEPR7R�sa=1;b=2tbad_sep(RRJR�s&;R�(RRR+RhRiRR*R�(RR�R�R=((s*/usr/lib64/python2.7/test/test_urlparse.pyt/test_parse_qs_separator_bad_value_env_or_configys

c	CsGx@tidfD]/}|jt��tjdd|�WdQXqWdS(NRsa=1;b=2R�(R+RhRiRR*(RR�((s*/usr/lib64/python2.7/test/test_urlparse.pyt%test_parse_qs_separator_bad_value_arg�scCs�x�dd
dfD]�\}}t���}tdt���}|dkrx|jt��tj|d|d	d
�WdQXn|r�||d<n|jt��tj|d	d
�WdQXWdQXWdQXqWdS(Nsa&b&cRsa;b;cRsa&b;cR�R7R�tmax_num_fieldsiR�(sa&b&cR(sa;b;cR(sa&b;cR�(RRR+RhRiRR*(RtqsR�R�R=((s*/usr/lib64/python2.7/test/test_urlparse.pyt"test_parse_qs_separator_num_fields�s"
c
Cs
|jd��Tt��D}d|d<tjd�}|j|idgd6dgd6�WdQXWdQX|jd��>tjd	d
d�}|j|idgd6dgd6�WdQXt��J}d|d<tjd	d
d�}|j|idgd6dgd6�WdQXdS(Nt~t!R�sa=1!b=2~c=3R	Rs2~c=3Rsa=1$b=2~c=3R�t$(R�RRR4R(RR�R#((s*/usr/lib64/python2.7/test/test_urlparse.pyt test_parse_qs_separator_priority�s
0*
c	
Cs�d}d�|D�}gtttdtj��D]7}|ttj|�j��@r2||kr2|^q2}|j	d|�|j	d|�t
jd�|jt
��t
jd�WdQXx�dd	d
gD]�}xxddgD]j}xa|D]Y}d
j||j|��}tjr%d|GHn|jt
��t
j|�WdQXq�Wq�Wq�W|jt
��}t
jd�WdQX|jt|j�d�|j|jjdt�dS(Nu/:#?@cSs%h|]}djt|���qS(s{:04X}(R�tord(t.0R
((s*/usr/lib64/python2.7/test/test_urlparse.pys	<setcomp>�s	i�u℀u#uhttp://プ:80uhttp://プ︓80uhttpuhttpsuftpunetloc{}false.netlocun{}user@netlocu{}://{}/pathsChecking %ruhttp://example.com#@bing.comsYnetloc u'example.com\uff03@bing.com' contains invalid characters under NFKC normalizationi(tmaptunichrRztsyst
maxunicodetsettunicodedatat
decompositionR"tassertInRRRhRiR�RtverboseRtstrt	exceptiontassertIsInstancetargs(	Rt
illegal_charst	hex_charsR
tdenorm_charsRRR tcm((s*/usr/lib64/python2.7/test/test_urlparse.pyttest_urlsplit_normalization�s."

	(-t__name__t
__module__R'R2R6R>R@RARBRIRQRVRYR]R_RaRcRfRlRpRsRwRyR|R�R�R�R�R�R�R�R�R�t
contextlibtcontextmanagerR�R�R�R�R�R�R�R�R�R�(((s*/usr/lib64/python2.7/test/test_urlparse.pyRpsR	3			
	
	
							-		*	:	$	,		3			0	;	
								
					
			cCstjt�dS(N(Rtrun_unittestR(((s*/usr/lib64/python2.7/test/test_urlparse.pyt	test_main�st__main__( ttestRR�R�tunittestRttest.supportRtwarningsRRR�R�tos.pathR�R�R\R`RbReR)R�R�R?R3R�R�R;tTestCaseRR�R�(((s*/usr/lib64/python2.7/test/test_urlparse.pyt<module>s�			!		!$$*!										'''-���a