403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/__pycache__/test_urllib.cpython-313.opt-1.pyc
�

��i)���SrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKJr SSK
Jr SSKJr SSKJr SSKJr SSKJr SS	KJr SSKrSSKrSSKrSSKrSS
KJr SSKr\R<(d\
R>"S5eSr Sq!S1S
jr"Sr#S2Sjr$"SS\%5r&"SS\%5r'"SS\
RP\5r)"SS\
RP5r*"SS\
RP5r+"SS\
RP\&\'5r,"SS\
RP\5r-"SS\
RP5r."S S!\
RP\&5r/"S"S#\
RP5r0"S$S%\
RP5r1"S&S'\
RP5r2"S(S)\
RP5r3"S*S+\
RP5r4"S,S-\&\
RP5r5"S.S/\
RP5r6\7S0:Xa\
Rp"5 gg!\a SrGN�f=f)3z;Regression tests for what was in Python 2's "urllib" module�N)�patch)�support)�	os_helper)�
socket_helper)�warnings_helper)�control_characters_c0)�ExtraAssertions)�	b64encodeztest requires gethostname()c�~�[[U55SSR5n[U5S:XaSU-nSU-$)z!Escape char as RFC 2396 specifies�N�z0%s�%)�hex�ord�upper�len)�char�hex_reprs  �%C:\Python313\\Lib\test\test_urllib.py�	hexescaper!s?���3�t�9�~�a�b�!�'�'�)�H�
�8�}����8�#����>��c���Ub[RRUS9nO[(d
[5nUqO[nUcUR	U5$UR	X5$)z.urlopen(url [, data]) -> open file-like object)�proxies)�urllib�request�FancyURLopener�
_urlopener�open)�url�datar�openers    r�urlopenr",s[�������.�.�w�.�?��
�Z��!���
����|��{�{�3����{�{�3�%�%rc��[R"S[45 [RR5sSSS5 $!,(df   g=f)Nz8FancyURLopener style of invoking requests is deprecated.)r�check_warnings�DeprecationWarningrrr�rrrr<s=��	�	'�	'�
G��
 �
!��~�~�,�,�.�
!�
!�
!�s�A�
Ac�^^^�"U4SjS[R5m"UU4SjS[RR5mUTlT$)Nc�F>�\rSrSrSrU4SjrSrS
SjrS
SjrSr	S	r
g)�fakehttp.<locals>.FakeSocket�Dr
c�>�UTlg�N)�buf)�selfr �FakeHTTPConnections  �r�sendall�$fakehttp.<locals>.FakeSocket.sendallGs���%)��"rc�0�U=RS-
slU$)Nr
)�io_refs)r.�args�kwdss   r�makefile�%fakehttp.<locals>.FakeSocket.makefileJs���L�L�A��L��KrNc�d�UR(ag[RRX5$�Nr)�closed�io�BytesIO�read)r.�amts  rr=�!fakehttp.<locals>.FakeSocket.readNs���{�{���:�:�?�?�4�-�-rc�d�UR(ag[RRX5$r9)r:r;r<�readline)r.�lengths  rrA�%fakehttp.<locals>.FakeSocket.readlineSs!���{�{���:�:�&�&�t�4�4rc��U=RS-slURS:Xa [RRU5 gg)Nr
r)r3r;r<�close�r.s rrE�"fakehttp.<locals>.FakeSocket.closeXs3���L�L�A��L��|�|�q� ��
�
� � ��&�!rr&r,)�__name__�
__module__�__qualname__�__firstlineno__r3r0r6r=rArE�__static_attributes__)r/s�r�
FakeSocketr)Ds!�����	*�	�	.�
	5�
	'rrMc�B>�\rSrSrSrU4SjrY(aSrSrgSrg)�$fakehttp.<locals>.FakeHTTPConnection�]Nc�h>�T"UR5UlUR[U5lgr,)�fakedata�sock�type�fakesock)r.rMs �r�connect�,fakehttp.<locals>.FakeHTTPConnection.connectbs#���"�4�=�=�1�D�I�"&�)�)�D��J�rc��gr,r&rFs rrE�*fakehttp.<locals>.FakeHTTPConnection.closek���r)rS)rHrIrJrKr-rVrErL)rM�
mock_closes��rr/rO]s�����	,��

�rr/)r;r<�http�client�HTTPConnectionrR)rRr[r/rMs `@@r�fakehttpr_Cs?���'�R�Z�Z�'�2��T�[�[�7�7�� #+����rc�$�\rSrSrSSjrSrSrg)�
FakeHTTPMixin�rc�~�[XS9n[RRUlU[Rlg)N�r[)r_r\r]r^�_connection_class)r.rRr[�fake_http_classs    rr_�FakeHTTPMixin.fakehttpss*��"�8�C��!%���!;�!;���%4����"rc�B�UR[Rlgr,)rer\r]r^rFs r�
unfakehttp�FakeHTTPMixin.unfakehttpxs��%)�%;�%;����"r)reN�F)rHrIrJrKr_rirLr&rrrarars��5�
<rrac� �\rSrSrSrSrSrg)�FakeFTPMixin�|c��"SS[5n[RRUlU[Rlg)Nc�.�\rSrSrSSjrSrSrSrg)�,FakeFTPMixin.fakeftp.<locals>.FakeFtpWrapper�~Nc��gr,r&)r.�user�passwd�host�port�dirs�timeout�
persistents        r�__init__�5FakeFTPMixin.fakeftp.<locals>.FakeFtpWrapper.__init__s��rc�0�[R"5S4$)Nr)r;r<)r.�filerTs   r�retrfile�5FakeFTPMixin.fakeftp.<locals>.FakeFtpWrapper.retrfile�s���z�z�|�Q��&rc��gr,r&rFs rrE�2FakeFTPMixin.fakeftp.<locals>.FakeFtpWrapper.close�rZrr&)NT)rHrIrJrKr{rrErLr&rr�FakeFtpWrapperrq~s��HL� $�
�
'�
rr�)�objectrr�
ftpwrapper�_ftpwrapper_class)r.r�s  r�fakeftp�FakeFTPMixin.fakeftp}s.��		�V�		�"(���!:�!:���$2����!rc�B�UR[Rlgr,)r�rrr�rFs r�	unfakeftp�FakeFTPMixin.unfakeftp�s��$(�$:�$:����!r)r�N)rHrIrJrKr�r�rLr&rrrmrm|s��
3�;rrmc�x�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrg)�urlopen_FileTests�z�Test urlopen() opening a temporary file.

Try to test as much functionality as possible so as to cut down on reliance
on connecting to the Net for testing.

c���[SURR-S5Ul[	[
RS5nURUR5 UR5 [
RUl	[RR[R"UR55Ul[!SUR-5Ulg!UR5 f=f)Nztest_urllib: %s
�ascii�wb�file:%s)�bytes�	__class__rH�textrr�TESTFN�writerE�pathnamer�parse�quote�os�fsencode�quoted_pathnamer"�returned_obj)r.�fs  r�setUp�urlopen_FileTests.setUp�s����-����0G�0G�G�!�#��	���!�!�4�(��	�
�G�G�D�I�I��
�G�G�I�!�(�(��
�%�|�|�1�1�"�+�+�d�m�m�2L�M���#�I��0D�0D�$D�E����
�G�G�I�s�C$�$C6c��URR5 [R"[R
5 g)zShut down the open objectN)r�rEr��removerr�rFs r�tearDown�urlopen_FileTests.tearDown�s&�������!�
�	�	�)�"�"�#rc�N�SHnURURU5 M! g)N)	r=rA�	readlines�filenorE�info�geturl�getcode�__iter__)�
assertHasAttrr��r.�attrs  r�test_interface� urlopen_FileTests.test_interface�s&��G�D����t�0�0�$�7�Grc�l�URURURR55 gr,)�assertEqualr�r�r=rFs r�	test_read�urlopen_FileTests.test_read�s%��������D�$5�$5�$:�$:�$<�=rc���URURURR55 URSURR5S5 g)NrzKcalling readline() after exhausting the file did not return an empty string)r�r�r�rArFs r�
test_readline�urlopen_FileTests.test_readline�sK��������D�$5�$5�$>�$>�$@�A�����d�/�/�8�8�:�3�	4rc��URR5nUR[U5SS5 URUSURS5 g)Nr
z.readlines() returned the wrong number of linesrz"readlines() returned improper text)r�r�r�rr�)r.�
lines_lists  r�test_readlines� urlopen_FileTests.test_readlines�sM���&�&�0�0�2�
�����Z��!�I�	K�����A���	�	�=�	?rc���URR5nURU[S5 UR	[
R"U[UR55URS5 g)Nzfileno() did not return an intzTReading on the file descriptor returned by fileno() did not return the expected text)	r�r��assertIsInstance�intr�r�r=rr�)r.�file_nums  r�test_fileno�urlopen_FileTests.test_fileno�sW���$�$�+�+�-�����h��-M�N��������3�t�y�y�>�:�D�I�I�<�	=rc�8�URR5 gr,)r�rErFs r�
test_close�urlopen_FileTests.test_close�s��	
�����!rc��URURR[RR
5 gr,)r�r��headers�email�message�MessagerFs r�test_headers�urlopen_FileTests.test_headers�s(�����d�/�/�7�7����9N�9N�Orc�d�URURRUR5 gr,)r�r�rr�rFs r�test_url�urlopen_FileTests.test_url�s$������*�*�.�.��0D�0D�Erc�N�URURR5 gr,)�assertIsNoner��statusrFs r�test_status�urlopen_FileTests.test_status�s�����$�+�+�2�2�3rc��URURR5[RR
5 gr,)r�r�r�r�r�r�rFs r�	test_info�urlopen_FileTests.test_info�s+�����d�/�/�4�4�6��
�
�8M�8M�Nrc�l�URURR5UR5 gr,)r�r�r�r�rFs r�test_geturl�urlopen_FileTests.test_geturl�s'������*�*�1�1�3�T�5I�5I�Jrc�V�URURR55 gr,)r�r�r�rFs r�test_getcode�urlopen_FileTests.test_getcode�s�����$�+�+�3�3�5�6rc�`�URHnURXR5 M  gr,)r�r�r�)r.�lines  r�	test_iter�urlopen_FileTests.test_iter�s&���%�%�D����T�9�9�-�&rc�|�UR[[RRSUR
-5 g)Nz./)�assertRaises�
ValueErrorrrr"r�rFs r�test_relativelocalfile�(urlopen_FileTests.test_relativelocalfile�s'�����*�V�^�^�%;�%;�D�4�=�=�<P�Qr)r�r�r�r�N)rHrIrJrK�__doc__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rLr&rrr�r��s]���F�$�
8�>�4�?�=�"�
P�F�4�O�K�7�.�Rrr�c�8�\rSrSrSrSrSrSrSrSr	Sr
g	)
�
ProxyTests��c��UR[R"55Ul[	[
R5H4nSUR5;dMURRU5 M6 g)N�proxy)	�enterContextr�EnvironmentVarGuard�env�listr��environ�lower�unset)r.�ks  rr��ProxyTests.setUp�sN���$�$�Y�%B�%B�%D�E����b�j�j�!�A��!�'�'�)�#������q�!�"rc���URRSS5 [RR	5nURSUS5 URRSS5 UR
[RRS55 UR
[RRS55 UR
[RRS55 g)N�NO_PROXY�	localhost�no�0localhost, anotherdomain.com, newdomain.com:1234�anotherdomain.com�anotherdomain.com:8888�newdomain.com:1234)r��setrr�getproxies_environmentr��
assertTrue�proxy_bypass_environment�r.rs  r�+test_getproxies_environment_keep_no_proxies�6ProxyTests.test_getproxies_environment_keep_no_proxies�s��������Z��-��.�.�7�7�9������g�d�m�4������Z�!S�T�������?�?�@S�T�U�������?�?�@X�Y�Z�������?�?�@T�U�Vrc��URRSS5 [RR	5nURSUS5 URRSS5 [RR	5nUR
SU5 URRS5 URRS5 g!URRS5 URRS5 f=f)N�
HTTP_PROXY�http://somewhere:3128r\�REQUEST_METHOD�GET)r�r�rrr�r��assertNotInr�rs  r�test_proxy_cgi_ignore� ProxyTests.test_proxy_cgi_ignores���		)��H�H�L�L��'>�?��n�n�;�;�=�G����4�g�f�o�F��H�H�L�L�)�5�1��n�n�;�;�=�G����V�W�-��H�H�N�N�+�,��H�H�N�N�<�(��
�H�H�N�N�+�,��H�H�N�N�<�(�s�BC�8Dc���[RRnURR	SS5 URU"S55 URU"S55 URU"S55 URU"S55 URU"S55 URU"S55 URU"S	55 URU"S
55 URU"S55 URU"S55 URU"S
55 UR
U"S55 UR
U"S55 UR
U"S55 g)Nr�z8localhost, anotherdomain.com, newdomain.com:1234, .d.o.tr��	LocalHost�	LOCALHOSTz
.localhostr�z.newdomain.com:1234z	foo.d.o.tzd.o.tr�z.anotherdomain.com:8888zwww.newdomain.com:1234�prelocalhost�
newdomain.comznewdomain.com:1235�rrrr�r�r�assertFalse�r.�bypasss  r�(test_proxy_bypass_environment_host_match�3ProxyTests.test_proxy_bypass_environment_host_matchs �����8�8�������Z�O�	Q�����{�+�,�����{�+�,�����{�+�,�����|�,�-�����3�4�5�����4�5�6�����{�+�,�����w��(�����7�8�9�����8�9�:�����7�8�9������/�0������0�1����� 4�5�6rc��[RRnURR	SS5 URU"S55 URU"S55 URR	SS5 URU"S55 UR
U"S55 UR
U"S55 g)Nr��*rr�z*, anotherdomain.comr�rrs  r�*test_proxy_bypass_environment_always_match�5ProxyTests.test_proxy_bypass_environment_always_matchs������8�8�������Z��%������/�0�����3�4�5������Z�!7�8�����2�3�4������0�1����� 4�5�6rc��[RRnURR	SS5 URU"S55 URU"S55 URU"S55 g)Nr�r�z
localhost
zanotherdomain.com:8888
znewdomain.com:1234
)rrrr�r�rrs  r�%test_proxy_bypass_environment_newline�0ProxyTests.test_proxy_bypass_environment_newline)sb�����8�8�������Z�G�	I�����
�.�/����� :�;�<����� 6�7�8r)r�N)rHrIrJrKr�rrrrrrLr&rrr�r��s!��"�	W�
)�7�&7�9rr�c�&�\rSrSrSrSrSrSrg)�ProxyTests_withOrderedEnvi2c�j�[RUl[R"5[lgr,)r�r��
_saved_env�collections�OrderedDictrFs rr��ProxyTests_withOrderedEnv.setUp4s���*�*��� �,�,�.��
rc�.�UR[lgr,)r"r�r�rFs rr��"ProxyTests_withOrderedEnv.tearDown:s
���_�_��
rc�~�S[RS'S[RS'UR[RRS55 UR[RRS55 S[RS'S[RS'[RR
5nUR0U5 S	[RS'S
[RS'UR[RRS55 UR[RRS55 UR[RRS55 UR[RRS
55 UR[RRS55 S[RS'S[RS'[RR
5nURSUS5 g)N��no_proxyr��No_Proxy�	arbitrary�
http_proxyrrz%localhost, noproxy.com, my.proxy:1234zxyz.comznoproxy.com:5678z
my.proxy:1234zmy.proxyzhttp://somewhereelse:3128�
Http_Proxyr\)	r�r�rrrrr�r�rrs  r�,test_getproxies_environment_prefer_lowercase�FProxyTests_withOrderedEnv.test_getproxies_environment_prefer_lowercase=s���!#��
�
�:��!,��
�
�:��������@�@��M�N�������@�@��M�N�#%��
�
�<� �#:��
�
�<� ��.�.�7�7�9������W�%�!H��
�
�:��!*��
�
�:��������?�?��L�M�������?�?�@R�S�T�������?�?��P�Q�������@�@��L�M�������@�@��M�N�#:��
�
�<� �#>��
�
�<� ��.�.�7�7�9�����0�'�&�/�Br)r"N)rHrIrJrKr�r�r/rLr&rrr r 2s��/�%�Crr c��\rSrSrSrSrSrSr\R"\
S5S5r\R"\
S5S5r\R"\
S5S	5r
\R"\
S5S
5rSrSrS
rSrSrSrSrSrSrSrSr\R6"\R:SS5S5rSrSr Sr!Sr"g)�urlopen_HttpTestsiVz.Test urlopen() opening a fake http connection.c��URSU-S-5 [S5nURUR5S5 URUR5S5 URUR	5S5 URUR5S5 UR
5 g!UR
5 f=f)NsHTTP/s 200 OK

Hello!�http://python.org/�Hello!r���r_r"r�rAr�r�ri)r.�ver�fps   r�
check_read�urlopen_HttpTests.check_readYs����
�
�h��n�'?�?�@�	��-�.�B����R�[�[�]�I�6����R�[�[�]�C�0����R�Y�Y�[�*>�?����R�Z�Z�\�3�/��O�O���D�O�O��s�BB5�5Cc���SnURS5 [RRU5nUR	UR5U5 UR
5 g!UR
5 f=f)Nz-http://docs.python.org/library/urllib.html#OK�HTTP/1.1 200 OK

Hello!)r_rrr"r�r�ri)r.rr9s   r�test_url_fragment�#urlopen_HttpTests.test_url_fragmentdsX��=���
�
�6�7�	����'�'��,�B����R�Y�Y�[�#�.��O�O���D�O�O��s�?A%�%A7c���URS5 [S5nURURR5 UR5 g!UR5 f=f)Nr=�http://www.python.org)r_r"rr9�
will_closeri)r.�resps  r�test_willclose� urlopen_HttpTests.test_willclosensJ���
�
�6�7�	��2�3�D��O�O�D�G�G�.�.�/��O�O���D�O�O��s�0A�A&zssl module requiredc���[[SS55S/-GHn[U5nSUS3nURS5 [	U5RSS5n[RRnURUS	U35 [RRS
U35 SSS5 URUS	U35 [RRSU35 SSS5 [S
U35nURX&R55 UR5 GM g!,(df   N�=f!,(df   Nb=f!UR5 f=f)Nr�!�z//localhost:7777/test�/�HTTP/1.1 200 OK

Hello.�\�\\�contain control.*�http:�https:)r��range�chrr_�repr�replacer\r]�
InvalidURL�assertRaisesRegexrrr"r
r�ri)r.�char_nor�schemeless_url�escaped_char_reprrTrCs       r�(test_url_path_with_control_char_rejected�:urlopen_HttpTests.test_url_path_with_control_char_rejectedvsF���E�!�T�N�+�t�f�4�G��w�<�D�4�T�F�!�<�N��M�M�:�;�
"�%)��J�$6�$6�t�U�$C�!�!�[�[�3�3�
��+�+��"3�4E�3F� G�I��N�N�*�*�U�>�2B�+C�D�I��+�+��"3�4E�3F� G�I��N�N�*�*�V�N�3C�+D�E�I���~�&6�7�8��� � ��{�{�}�5����!�/5�I�I��I�I�����!�s=�A
E�#D9�.E�#E
�.5E�9
E	�E�

E	�E�E-c���URS5 SnSU-S-n[RRnUR	US5 [
RRSU35 SSS5 UR	US5 [
RRSU35 SSS5 [SU35nURS	UR55 URS
UR55 URSUR55 UR5 g!,(df   N�=f!,(df   N�=f!UR5 f=f)NrJz:localhost:7777?a=1 HTTP/1.1
X-injected: header
TEST: 123�//�:8080/test/?test=az*contain control.*\\r.*(found at least . .)rN�contain control.*\\nrO� �
�
)r_r\r]rTrUrrr"r
r�ri)r.rvrWrTrCs     r�4test_url_path_with_newline_header_injection_rejected�Furlopen_HttpTests.test_url_path_with_newline_header_injection_rejected�s%���
�
�6�7�O�����';�;��	����/�/�J��'�'��I�K����&�&��~�.>�'?�@�K��'�'�
�4K�L����&�&���/?�'@�A�M��U�>�"2�3�4�D����S�$�+�+�-�0����T�4�;�;�=�1����T�4�;�;�=�1��O�O��K�K��M�L��
�O�O��s<�,E�	#D0�,E�#E�)A6E�0
D>�:E�
E�E�E$c�2�[[SS55S/-H�n[U5nSUS3nURS5 [	U5RSS5n[RRnURUS	U35 [S
U35 SSS5 URUS	U35 [SU35 SSS5 UR5 M� g!,(df   NO=f!,(df   N4=f!UR5 f=f)NrrGrHz//localhostz/test/rJrKrLrMrNrO)r�rPrQr_rRrSr\r]rTrUr"ri)r.rVrrWrXrTs      r�(test_url_host_with_control_char_rejected�:urlopen_HttpTests.test_url_host_with_control_char_rejected�s���E�!�T�N�+�t�f�4�G��w�<�D�*�4�&��7�N��M�M�:�;�	
"�$(��J�$6�$6�t�U�$C�!�!�[�[�3�3�
��+�+��"3�4E�3F� G�I��e�N�#3�4�5�I��+�+�J�:K�L]�K^�8_�`��f�^�$4�5�6�a����!�5�I�I��a�`�����!�s=�A
D�
C"�D�6C3�D�"
C0	�,D�3
D	�=D�Dc��URS5 SnSU-S-n[RRnUR	US5 [SU35 SSS5 UR	US5 [SU35 SSS5 UR
5 g!,(df   NH=f!,(df   N0=f!UR
5 f=f)	NrJzlocalhost
X-injected: header
r\r]zcontain control.*\\rrNr^rO)r_r\r]rTrUr"ri)r.rvrWrTs    r�4test_url_host_with_newline_header_injection_rejected�Furlopen_HttpTests.test_url_host_with_newline_header_injection_rejected�s����
�
�6�7�4�����';�;��	����/�/�J��'�'��3�5��%��/�0�1�5��'�'�
�4K�L��&�� 0�1�2�M�
�O�O��
5�5��M�L��
�O�O��s;�,B<�	B�B<�2B+�B<�
B(�$B<�+
B9�5B<�<Cc�&�URS5 g)Ns0.9�r:rFs r�
test_read_0_9�urlopen_HttpTests.test_read_0_9�s��	
����rc�&�URS5 g)Ns1.0rkrFs r�
test_read_1_0�urlopen_HttpTests.test_read_1_0��������rc�&�URS5 g)Ns1.1rkrFs r�
test_read_1_1�urlopen_HttpTests.test_read_1_1�rqrc�h�URSSS9 UR[RR5n[R
R
S5 SSS5 WRR5 UR5 g!,(df   N9=f!UR5 f=f)Ns�HTTP/1.1 401 Authentication Required
Date: Wed, 02 Jan 2008 03:03:54 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e
Connection: close
Content-Type: text/html; charset=iso-8859-1
Trdr4)
r_r�r�error�	HTTPErrorrr"�	exceptionrEri)r.�cms  r�test_read_bogus�!urlopen_HttpTests.test_read_bogus�s����
�
��
�	�	�	��"�"�6�<�<�#9�#9�:�b����&�&�';�<�;��L�L��� ��O�O��	;�:��
�O�O��s"�)B� B�"B�
B�B�B1c�n�URSSS9 SnUR[RRU5n[R
R
S5 SSS5 WRR5 UR5 g!,(df   N9=f!UR5 f=f)Ns�HTTP/1.1 302 Found
Date: Wed, 02 Jan 2008 03:03:54 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e
Location: file://guidocomputer.athome.com:/python/license
Connection: close
Content-Type: text/html; charset=iso-8859-1
TrdzRedirection to url 'file:r4)
r_rUrrvrwrr"rxrEri)r.�msgrys   r�test_invalid_redirect�'urlopen_HttpTests.test_invalid_redirect�s����
�
���
	�	�	�-�C��'�'����(>�(>��D�����&�&�';�<�E��L�L��� ��O�O��	E�D��
�O�O��s"�,B"� B�"B"�
B�B"�"B4c��[[5R5H�nURSSS9 UR	[
RR5n[
RRS5 SSS5 WRR5 UR5 M� g!,(df   N==f!UR5 f=f)Ns_HTTP/1.1 302 Found
Location: file://guidocomputer.athome.com:/python/license
Connection: close
Trd�http://something)
rPr�maxtriesr_r�rrvrwrr"rxrEri)r.�irys   r�test_redirect_limit_independent�1urlopen_HttpTests.test_redirect_limit_independent�s����~�'�0�0�1�A��M�M���
�
�
"��&�&�v�|�|�'=�'=�>�"��N�N�*�*�+=�>�?����"�"�$����!�2�?�>�����!�s#�)C� B2�;"C�2
C	�<C�Cc��URS5 UR[[S5 UR	5 g!UR	5 f=f)Nrr�)r_r��OSErrorr"rirFs r�test_empty_socket�#urlopen_HttpTests.test_empty_sockets=��	
�
�
�c��	����g�w�0B�C��O�O���D�O�O��s	�?�Ac�4�UR[RR5n[	S5 SSS5 URWRR5 URURR5 g!,(df   NY=f)Nz/file://localhost/a/file/which/doesnot/exists.py)	r�rrv�URLErrorr"rrx�filename�reason�r.�es  r�test_missing_localfile�(urlopen_HttpTests.test_missing_localfiles_��
�
�
�v�|�|�4�4�
5���E�F�6�������,�,�-�������*�*�+�6�
5���B	�	
Bc��[R"5upSUR[RR
S5-nUR
[RRU55 [U5nUR
U5 SSS5 [R"U5 [R"U5 UR[RRU55 UR[RR5 [U5 SSS5 g!,(df   N�=f![R"U5 [R"U5 f=f!,(df   g=f)Nzfile://localhost/rI)�tempfile�mkstemprSr��path�sepr�existsr"rE�unlinkrr�rrvr�)r.�fd�tmp_file�tmp_fileurl�fobjs     r�test_file_notexists�%urlopen_HttpTests.test_file_notexistss����'�'�)���)�H�,<�,<�R�W�W�[�[�#�,N�N��	 ��O�O�B�G�G�N�N�8�4�5���%������%�&�
�H�H�R�L��I�I�h�����������1�2�
�
�
�v�|�|�4�4�
5��K� �6�
5�
&�%��
�H�H�R�L��I�I�h���
5�
5�s0�9E�?D1�E�E3�1
D?�;E�.E0�3
Fc�8�SnUR[RR5n[	U5 SSS5 URWRR5 URURR5 g!,(df   NY=f)Nzftp:///path�
r�rrvr�r"rrxr�rr�)r.�test_ftp_urlr�s   r�test_ftp_nohost�!urlopen_HttpTests.test_ftp_nohost#se��$��
�
�
�v�|�|�4�4�
5���L�!�6�������-�-�.�������*�*�+�6�
5�s�B�
Bc�4�UR[RR5n[	S5 SSS5 URWRR5 URURR5 g!,(df   NY=f)Nz.ftp://localhost/a/file/which/doesnot/exists.pyr�r�s  r�test_ftp_nonexisting�&urlopen_HttpTests.test_ftp_nonexisting*sa��
�
�
�v�|�|�4�4�
5���D�E�6�������-�-�.�������*�*�+�6�
5�r��MAXFTPCACHErc��UR5 [RRSSSS/5[RRS'[S5 UR
5 g!UR
5 f=f)Nrt�passr���testzftp://localhost)r�rrr��ftpcacher"r�rFs r�test_ftp_cache_pruning�(urlopen_HttpTests.test_ftp_cache_pruning0s]������	�.4�n�n�.G�.G��PV�Xc�eg�ik�.l�F�N�N�#�#�F�+��%�&��N�N���D�N�N��s�A	A,�,A>c��URS5 [S5nURUR5S5 URUR5S5 URUR	5S5 URUR5S5 UR
5 g!UR
5 f=f)N�HTTP/1.0 200 OK

Hello!zhttp://user:pass@python.org/r5rr6r7)r.r9s  r�test_userpass_inurl�%urlopen_HttpTests.test_userpass_inurl9s����
�
�6�7�	��7�8�B����R�[�[�]�I�6����R�[�[�]�C�0����R�Y�Y�[�*H�I����R�Z�Z�\�3�/��O�O���D�O�O��s�BB/�/Cc��URS5 SnSRU5n[RRnS[UR
S55RS5-n[U5nURXCRRS55 URUR5S5 URUR5S5 URUR5U5 URUR5S	5 UR!5 g!UR!5 f=f)
Nr�za b:c dzhttp://{}@python.org/zAuthorization: Basic %s
�ASCIIzUTF-8r5rr6)r_�formatr\r]r^r
�encode�decoder"�assertInr-r�rA�assertNotEqualr�r�ri)r.�userpassr�fakehttp_wrapper�
authorizationr9s      r�test_userpass_inurl_w_spaces�.urlopen_HttpTests.test_userpass_inurl_w_spacesDs����
�
�6�7�	� �H�)�0�0��:�C�#�{�{�9�9��:�&�x���w�'?�@�G�G��P�Q�M����B��M�M�-�)=�)=�)D�)D�W�)M�N����R�[�[�]�I�6����R�[�[�]�C�0�����	�	��S�1����R�Z�Z�\�3�/��O�O���D�O�O��s�DD2�2Ec��[R"S[45 [RR5 SSS5 g!,(df   g=f�Nr))rr$r%rr�	URLopenerrFs r�test_URLopener_deprecation�,urlopen_HttpTests.test_URLopener_deprecationWs3��
�
+�
+�R�0B�,C�
D��N�N�$�$�&�E�
D�
D�s�A�
Ar&N)#rHrIrJrKr�r:r>rD�unittest�
skipUnless�sslrYrbrerhrlrorsrzr~r�r�r�r�r�r�rr�rrr�r�r�r�rLr&rrr2r2Vs��8�	�������3�4�"�5�"�4����3�4��5��2����3�4�"�5�"� ����3�4��5�� �
 � �
��"
"��,�!�,�,��\�\�&�.�.�-��3��4��	��&'rr2c�T�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rg)�urlopen_DataTestsi\z"Test urlopen() opening a data URL.c�
�UR[RR5 SUlSUlSUlSUlSUlUR[RRUR55UlUR[RRUR55UlUR[RRUR55Ul
g)Nutest data URLs :;,%=& ö Ä sU�PNG


IHDR{@��sRGB���IDAT�c```���?�
o/IEND�B`�zZdata:text/plain;charset=UTF-8,test%20data%20URLs%20%3A%3B%2C%25%3D%26%20%C3%B6%20%C3%84%20zPdata:text/plain;charset=ISO-8859-1;base64,dGVzdCBkYXRhIFVSTHMgOjssJT0mIPYgxCA%3Dz�data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7
QOjdAAAAAXNSR0IArs4c6QAAAA9JREFUCNdj%0AYGBg%2BP//PwAGAQL%2BCm8 vHgAAAABJRU5ErkJggg%3D%3D%0A%20)�
addCleanuprr�
urlcleanupr��image�text_url�text_url_base64�	image_urlr�r"�
text_url_resp�text_url_base64_resp�image_url_resprFs rr��urlopen_DataTests.setUp_s���������1�1�2�;��	�
F�	
�
�
(�	
�
�
�	
��
.�	
��
"�.�.��N�N�"�"�4�=�=�1�3���$(�$5�$5��N�N�"�"�4�#7�#7�8�%:��!�"�/�/����0F�0F�t�~�~�0V�W��rc�N�SHnURURU5 M! g)N)r=rAr�rEr�r�r�r�)r�r�r�s  rr�� urlopen_DataTests.test_interfaces&��G�D����t�1�1�4�8�Grc�L�URURR5[RR
5 UR
URR5R5SS/5 UR
URR5S[[UR555 [RRS5nUR
UR5R5SS/5 UR!5 g)N)z
text/plainr))�charsetz
ISO-8859-1zcontent-lengthzdata:,)r�zUS-ASCII)r�r�r�r�r�r�r�r��
get_paramsr��strrr�rrr"rE)r.�rs  rr��urlopen_DataTests.test_info�s������d�0�0�5�5�7����9N�9N�O�����2�2�7�7�9�D�D�F�
�!:�;�	=�����,�,�1�1�3�4D�E���D�J�J�� �	"��N�N�"�"�8�,���������,�,�.�
�!8�9�	;�	���	rc�<�URURR5UR5 URURR5UR
5 URURR5UR5 gr,)r�r�r�r�r�r�r�r�rFs rr��urlopen_DataTests.test_geturl�sp������+�+�2�2�4�d�m�m�D�����2�2�9�9�;�� � �	"�����,�,�3�3�5�t�~�~�Frc���URURR5R[	URR5R
55S5UR5 g�Nr�)r�r�r=r��dictr�r�r�rFs r�test_read_text� urlopen_DataTests.test_read_text�sZ������+�+�0�0�2�9�9���#�#�(�(�*�5�5�7�8��C�E�FJ�i�i�	Qrc���URURR5R[	URR5R
55S5UR5 gr�)r�r�r=r�r�r�r�r�rFs r�test_read_text_base64�'urlopen_DataTests.test_read_text_base64�sY������2�2�7�7�9�@�@���*�*�/�/�1�<�<�>�?�	�J�L��I�I�	rc�l�URURR5UR5 gr,)r�r�r=r�rFs r�test_read_image�!urlopen_DataTests.test_read_image�s%������,�,�1�1�3�T�Z�Z�@rc�b�UR[[RRS5 g)Nzdata:text/plain�r�r�rrr"rFs r�test_missing_comma�$urlopen_DataTests.test_missing_comma�s�����*�V�^�^�%;�%;�<M�Nrc�b�UR[[RRS5 g)Nzdata:;base64,Cg=r�rFs r�test_invalid_base64_data�*urlopen_DataTests.test_invalid_base64_data�s�����*�V�^�^�%;�%;�<N�Orc��[5H6nUR[[RR
SUS35 M8 [5H6nUR[[RR
SUS35 M8 g)Nzdata:text/html;z,datazdata:text/htmlz;base64,ZGF0YQ==)rr�r�rrr")r.�c0s  r�test_invalid_mediatype�(urlopen_DataTests.test_invalid_mediatype�sp��'�)�B����j����)?�)?� /��t�5�9�
;�*�(�)�B����j����)?�)?� .�r�d�2B�C�
E�*r)r�r�r�r�r�r�r�r�N)rHrIrJrKr�r�r�r�r�r�r�r�r�r�r�rLr&rrr�r�\s?��,�X�@9�	�G�Q��
A�O�P�Err�c�^�\rSrSrSrSrSrSrSSjrSr	Sr
S	rS
rSr
SrS
rSrg)�urlretrieve_FileTestsi�z(Test urllib.urlretrieve() on local filesc��UR[RR5 /UlUR[R5 SUl[[RS5nURUR5 UR5 UR5 g! g=f!WR5 f! f=f=f)Nstesting urllib.urlretriever�)r�rrr��	tempFiles�registerFileForCleanUprr�r�rr�rE)r.�FILEs  rr��urlretrieve_FileTests.setUp�s���������1�1�2����	
�#�#�I�$4�$4�5�1��	�	��	�(�(�$�/�D��J�J�t�y�y�!��J�J�L�������D��������D�s1�AB5�B.�.B2�5C�6C�C�C�	Cc�f�URHn[R"U5 M g! M#=fr,)r�r�r�)r.�eachs  rr��urlretrieve_FileTests.tearDown�s"���N�N�D����4��#���D�s�+�0c��[RRU5nS[RRU5-$)Nz	file://%s)r�r��abspathrr�pathname2url)r.�filePaths  r�constructLocalFileUrl�+urlretrieve_FileTests.constructLocalFileUrl�s.���7�7�?�?�8�,���V�^�^�8�8��B�B�Brc�0�[R"5up#URU5 [R"US5nURU5 UR
5 UR
5 U$! U$=f!WR
5 f! f=f=f)z�Creates a new temporary file containing the specified data,
registers the file for deletion during the test fixture tear down, and
returns the absolute path of the file.r�)r�r�r�r��fdopenr�rE)r.r �newFd�newFilePath�newFiles     r�createNewTempFile�'urlretrieve_FileTests.createNewTempFile�s}��
&�-�-�/���	��'�'��4��i�i��t�,�G��M�M�$���M�M�O��������
�D����������D�s0�A	A<�"A4�4A9�<B�=B�
B�B�Bc�:�URRU5 gr,)r��append)r.�fileNames  rr��,urlretrieve_FileTests.registerFileForCleanUp�s�������h�'rc��[RRS[R-5nURUS[R5 UR
US[RRS5 g)Nr�rr
zFdid not get an email.message.Message instance as second returned value)
rr�urlretrieverr�r�r�r�r�r�)r.�results  r�
test_basic� urlretrieve_FileTests.test_basic�sb�����+�+�I�	�8H�8H�,H�I��������I�$4�$4�5����f�Q�i����)>�)>�9�	:rc�D�S[R-nURU5 [RRUR
[R5U5nURXS5 UR[RRU5S5 [US5nUR5nUR5 UR5 URURU5 g! N!=f!UR5 f! f=f=f)N�%s.2rzcopy of the file was not made�rb)rr�r�rrrrr�rr�r�r�rr=rEr�)r.�second_temprr�r�s     r�	test_copy�urlretrieve_FileTests.test_copy�s����y�/�/�/���#�#�K�0����+�+�D�,F�,F����-�*�,������Q�i�0���������{�3�69�	:��K��&��	��9�9�;�D��J�J�L�����������D�)��
�D��������D�s0�2 D�C?�?D�D�D�D�D�Dc��^�S/4U4SjjnS[R-nTRU5 [RRTR
[R5X!5 g)Nrc��>�TRU[5 TRU[5 TRU[5 TRXS5 USS-US'g)Nrr
)r�r�r�)�block_count�block_read_size�	file_size�count_holderr.s    �r�
hooktester�9urlretrieve_FileTests.test_reporthook.<locals>.hooktestersW����!�!�+�s�3��!�!�/�3�7��!�!�)�S�1����[�q�/�:�*�1�o��1�L��Orr)rr�r�rrrr)r.r!rs`  r�test_reporthook�%urlretrieve_FileTests.test_reporthooksV���NO�S�	2��y�/�/�/���#�#�K�0����"�"��&�&�y�'7�'7�8��	%rc��/nU4SjnUR5n[RRUR	U5[
RU5 UR[U5S5 URUSSS5 g)Nc�*�URXU45 gr,�r
�rrr�_reports    rr!�Aurlretrieve_FileTests.test_reporthook_0_bytes.<locals>.hooktester����N�N�K�)�D�Err
rr�	r
rrrrrr�r�r�r.�reportr!�srcFileNames    r�test_reporthook_0_bytes�-urlretrieve_FileTests.test_reporthook_0_bytesst����HN�	F��,�,�.�����"�"�4�#=�#=�k�#J����j�	*�����V��a�(�������1��q�)rc�H�/nU4SjnURS5n[RRUR	U5[
RU5 UR[U5S5 URUSSS5 URUSSS5 g)Nc�*�URXU45 gr,r'r(s    rr!�Aurlretrieve_FileTests.test_reporthook_5_bytes.<locals>.hooktester"r+rsxxxxxrr�r
r,r-s    r�test_reporthook_5_bytes�-urlretrieve_FileTests.test_reporthook_5_bytess�����HN�	F��,�,�X�6�����"�"�4�#=�#=�k�#J����j�	*�����V��a�(�������1��q�)�������1��q�)rc��/nU4SjnURSS-5n[RRUR	U5[
RU5 UR[U5S5 URUSSS5 URUSSS5 URUSSS5 URUSSS5 g)	Nc�*�URXU45 gr,r'r(s    rr!�Durlretrieve_FileTests.test_reporthook_8193_bytes.<locals>.hooktester0r+r�xi �rrr
i r,r-s    r�test_reporthook_8193_bytes�0urlretrieve_FileTests.test_reporthook_8193_bytes+s�����HN�	F��,�,�T�D�[�9�����"�"�4�#=�#=�k�#J����j�	*�����V��a�(�������1��t�,�������1��t�,�������1��t�,�������1��t�,r)r�r�N)r)rHrIrJrKr�r�r�rr
r�rrr#r0r6r=rLr&rrr�r��s=��2��0�C�� (�:�*�$%�	*�*�-rr�c�$�\rSrSrSrSrSrSrg)�urlretrieve_HttpTestsi<z5Test urllib.urlretrieve() using fake http connectionsc��UR[RR5 UR	S5 SnUR[RR5 [RR[RUS9 UR5 SSS5 g!UR5 f=f!,(df   g=f)N��HTTP/1.1 200 OK
Date: Wed, 02 Jan 2008 03:03:54 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e
Connection: close
Content-Length: 100
Content-Type: text/html; charset=iso-8859-1

FF
c��gr,r&)�par1�par2�par3s   r�_reporthook�Yurlretrieve_HttpTests.test_short_content_raises_ContentTooShortError.<locals>._reporthookLs��r)�
reporthook�r�rrr�r_r�rv�ContentTooShortErrorrr�
TEST_HTTP_URLri)r.rGs  r�.test_short_content_raises_ContentTooShortError�Durlretrieve_HttpTests.test_short_content_raises_ContentTooShortError?s���������1�1�2��
�
��	�	��
�
�v�|�|�@�@�
A�
"����*�*�7�+@�+@�6A�+�C����!�B�
A��
���!��B�
A�s$�'C�),B/�C�/C�C�
Cc��UR[RR5 UR	S5 UR[RR5 [RR[R5 UR5 SSS5 g!UR5 f=f!,(df   g=f)NrBrJrFs r�Atest_short_content_raises_ContentTooShortError_without_reporthook�Wurlretrieve_HttpTests.test_short_content_raises_ContentTooShortError_without_reporthookVs���������1�1�2��
�
��	��
�
�v�|�|�@�@�
A�
"����*�*�7�+@�+@�A����!�	B�
A�����!��	B�
A�s$�$C�&-B-�C�-B?�?C�
Cr&N)rHrIrJrKr�rMrPrLr&rrr@r@<s��?�"�."rr@c�N�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
Srg
)�QuotingTestsiia)Tests for urllib.quote() and urllib.quote_plus()

According to RFC 3986 (Uniform Resource Identifiers), to escape a
character you write it as '%' + <2 character US-ASCII hex value>.
The Python code of ``'%' + hex(ord(<character>))[2:]`` escapes a
character properly. Case does not matter on the hex letters.

The various character sets specified are:

Reserved characters : ";/?:@&=+$,"
    Have special meaning in URIs and must be escaped if not being used for
    their special meaning
Data characters : letters, digits, and "-_.!~*'()"
    Unreserved and do not need to be escaped; can be, though, if desired
Control characters : 0x00 - 0x1F, 0x7F
    Have no use in URIs so must be escaped
space : 0x20
    Must be escaped
Delimiters : '<>#%"'
    Must be escaped
Unwise : "{}|\^[]`"
    Must be escaped

c��SR/SQ5n[RRU5nUR	XSU<SU<35 [RRU5nUR	XSU<SU<35 g)Nr))�ABCDEFGHIJKLMNOPQRSTUVWXYZ�abcdefghijklmnopqrstuvwxyz�
0123456789z_.-~�using quote(): � != �using quote_plus(): )�joinrr�r�r��
quote_plus)r.�do_not_quoters   r�test_never_quote�QuotingTests.test_never_quote�su���x�x�!)�*�����#�#�L�1������v�6B�F�K�	M����(�(��6������v�:F��O�	Qrc�r�UR[RRRSS5 g)NrrI)r�rr�r��__defaults__rFs r�test_default_safe�QuotingTests.test_default_safe�s'��������+�+�8�8��;�S�Arc��Sn[RRXS9nURXSU<SU<35 [RR	UUS9nURXSU<SU<35 [RRUSS9nURXSU<SU<35 [RRSSS	S
9n[RRSSSS
9nURX2SU<SU<35 [RRSSSS
9n[RRSSSS
9nURX2SU<SU<35 g)
Nz<>��saferXrYrZs<>uaüb�latin-1�ü)�encodingrfr)��)rr�r�r�r\)r.�quote_by_defaultr�expects    r�	test_safe�QuotingTests.test_safe�sY�������#�#�$4�#�L�����)�6�6F��O�	Q����(�(�)9�.>�)�@�����)�6�*�F�4�	5����#�#�$4�5�#�A�����)�6�6F��O�	Q����#�#�H�y�v�#�N�����#�#�H�y�r�#�J������� �&�*�	+����#�#�H�y�w�#�O�����#�#�H�y�r�#�J������� �&�*�	+rc��[S5Vs/sHn[U5PM nnURS5 UR[S55 SRU5nUH�n[R
R
U5nUR[U5USU<S[U5<SU<35 [R
RU5nUR[U5USU<S	[U5<SU<35 M� AS
nSn[R
R
U5nURXdSU<SU<35 [R
RU5nURXdSU<SU<35 gs snf)
N� z
<>#%"{}|\^[]`rHr)rXz should be escaped to z, not rZz should be escapes to zab[]cdz
ab%5B%5DcdrY)
rPrQr
r[rr�r�r�rr\)r.�num�should_quoterr�
partial_quote�expecteds       r�test_default_quoting�!QuotingTests.test_default_quoting�sE��-2�"�I�6�I�S��C��I��6����,�-����C��H�%��w�w�|�,�� �D��\�\�'�'��-�F����Y�t�_�f�#�I�d�O�V�=�
>��\�\�,�,�T�2�F����Y�t�_�f�#�I�d�O�V�=�
>�!�
� �
������#�#�M�2������6�6>��G�	I����(�(��7������6�;C�V�L�	N��-7s�Fc
�H�[RRS5nURU[	S5SU<S[	S5<35 [RRS5nURUSSU-5 SnUR
S[	S55n[RRU5nURX1SU<SU<35 UR
SS5n[RRU5nURX1SU<SU<35 g)Nr_rXrY�+zusing quote_plus(): %r != +z
a b cd e frZ)rr�r�r�rr\rS)r.r�givenrls    r�test_quoting_space�QuotingTests.test_quoting_space�s������#�#�C�(�������3��6<�i��n�M�	O����(�(��-�������6��?�	A������s�I�c�N�3�����#�#�E�*�������6<�f�E�	G����s�C�(�����(�(��/�������;A�6�J�	Lrc��UR[RRS5S5 UR[RRSS5S5 UR[RRS5S5 UR[RRSS5S5 g)Nzalpha+beta gammazalpha%2Bbeta+gammarxzalpha+beta+gammasalpha+beta gamma�+)r�rr�r\rFs r�test_quoting_plus�QuotingTests.test_quoting_plus�s���������0�0�1C�D�-�	/�������0�0�1C�S�I�+�	-�	
������0�0�1D�E�-�	/�	
������0�0�1C�T�J�+�	-rc�L�SnSn[RRU5nURX#SU<SU<35 UR	[
[RRUSS9 [RR
U5nURX#SU<SU<35 g)N���ab��%A2%D8ab%FFrXrYrg�rizusing quote_from_bytes(): )rr�r�r�r��	TypeError�quote_from_bytes�r.ryrlrs    r�test_quote_bytes�QuotingTests.test_quote_bytes�s���!�������#�#�E�*�������6<�f�E�	G�	
���)�V�\�\�%7�%7��%.�	�	0����.�.�u�5�������"�F�,�	-rc�6�SnSn[RRU5nURX#SU<SU<35 [RRUSSS9nURX#SU<SU<35 SnSn[RRUSS9nURX#SU<SU<35 S	nS
n[RRU5nURX#SU<SU<35 S	nUR	[
[RRUSS9 S	nSn[RRUSSS9nURX#SU<SU<35 S	nS
n[RRUSSS9nURX#SU<SU<35 g)Nu¢Øabÿz%C2%A2%C3%98ab%C3%BFrXrY�ri�errorsr�rgr��漢字�%E6%BC%A2%E5%AD%97z%3F%3FrSz%26%2328450%3B%26%2323383%3B�xmlcharrefreplace)rr�r�r�r��UnicodeEncodeErrorr�s    r�test_quote_with_unicode�$QuotingTests.test_quote_with_unicode�s��� ��'�����#�#�E�*�������6<�f�E�	G����#�#�E�D��#�F�������6<�f�E�	G�!�������#�#�E�I�#�>�������6<�f�E�	G���%�����#�#�E�*�������6<�f�E�	G������,�f�l�l�.@�.@�%�-6�	�	8��������#�#�E�I�+4�$�6�������6<�f�E�	G���/�����#�#�E�I�+>�$�@�������6<�f�E�	Grc��SnSn[RRUSS9nURX#SU<SU<35 SnSn[RRUSS	S
9nURX#SU<SU<35 g)Nu¢Ø ÿz
%A2%D8+%FFrgr�rZrYuab漢字 cdzab%3F%3F+cdrSr�)rr�r\r�r�s    r�test_quote_plus_with_unicode�)QuotingTests.test_quote_plus_with_unicode&s����������(�(���(�C�������;A�6�J�	L�$�������(�(���09�)�;�������;A�6�J�	Lrr&N)rHrIrJrKr�r^rbrmrurzr~r�r�r�rLr&rrrSrSis;���2Q�B�+�:N�8L�&
-�-� (G�T
LrrSc�N�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
Srg
)�UnquotingTestsi6zoTests for unquote() and unquote_plus()

See the doc string for quoting_Tests for details on quoting and such.

c	��/n[S5H�n[[U55n[U5n[RRU5nUR
XESU<SU<35 [RRU5nUR
XESU<SU<35 URU5 M� SRU5nA[RRU5nUR
URS5SSU-5 g)	N��using unquote(): rY�using unquote_plus(): r)rr
z/using unquote(): not all characters escaped: %s)rPrrQrr��unquoter��unquote_plusr
r[�count)r.�escape_listrqryrlr�
escape_strings       r�test_unquoting�UnquotingTests.test_unquoting=s�������:�C��c�#�h�'�E���X�F��\�\�)�)�%�0�F����V�V�<B�F�K�
M��\�\�.�.�u�5�F����V�V�$�f�.�
/�
���u�%������,�
�����%�%�m�4��������c�*�A�� &�'�	(rc���UR[[4[RR
S5 UR[[4[RR
S5 g)Nr&)r�r��AttributeErrorrr�r�rFs r�#test_unquote_rejects_none_and_tuple�2UnquotingTests.test_unquote_rejects_none_and_tupleRsD�����9�n�5�v�|�|�7K�7K�T�R����9�n�5�v�|�|�7K�7K�R�Prc���SnUn[RRU5nURX#SU<SU<35 SnUn[RRU5nURX#SU<SU<35 SnUn[RRU5nURX#SU<SU<35 Sn[	US5n[RRU5nURX#SU<SU<35 Sn[	US5n[RRU5nURX#SU<SU<35 Sn[	US5n[RRU5nURX#SU<SU<35 UR
[[4[RR
S5 UR
[[4[RR
S5 g)	Nz%xabr�rYz%xrr��using unquote_to_bytes(): r&)	rr�r�r�r��unquote_to_bytesr�r�r�r�s    r�test_unquoting_badpercent�(UnquotingTests.test_unquoting_badpercentVs����������%�%�e�,�������"�F�*,�	-��������%�%�e�,�������"�F�*,�	-��������%�%�e�,�������"�F�*,�	-����u�g�&�����.�.�u�5�������"�F�*,�	-����u�g�&�����.�.�u�5�������"�F�*,�	-����u�g�&�����.�.�u�5�������"�F�*,�	-����9�n�5�v�|�|�7T�7T�VZ�[����9�n�5�v�|�|�7T�7T�VX�Yrc�~�SnSn[RRU5nURX#SU<SU<35 g)Nz%Ab%eAs��r�rY�rr�r�r�r�s    r�test_unquoting_mixed_case�(UnquotingTests.test_unquoting_mixed_casezs<���������.�.�u�5�������"�F�,�	-rc��S[S5-nSn[RRU5nUR	X#SU<SU<35 [RRU5nUR	X#SU<SU<35 g)Nzab%sd�c�abcdrXrYr�)rrr�r�r�r�r�s    r�test_unquoting_parts�#UnquotingTests.test_unquoting_parts�su���)�C�.�(�������%�%�e�,�������6<�f�E�	G����*�*�5�1�������=C�V�L�	Nrc��SnUn[RRU5nURX#SU<SU<35 UR	SS5n[RRU5nURX#SU<SU<35 g)Nzare+there+spaces...r�rYrxr_r�)rr�r�r�rSr�r�s    r�test_unquoting_plus�"UnquotingTests.test_unquoting_plus�sz��%�������%�%�e�,�������8>��G�	I����s�C�(�����*�*�5�1�������=C�V�L�	Nrc���SnSn[RRU5nURX#SU<SU<35 [RRS5nSnURX#SU<SU<35 SnSn[RRU5nURX#SU<SU<35 S	nSn[RRU5nURX#SU<SU<35 g)
N�"br%C3%BCckner_sapporo_20050930.docsbrückner_sapporo_20050930.docr�rY�	漢%C3%BCs漢üs%A2%D8ab%FFr�s	%A2�ab%FFr�r�s    r�test_unquote_to_bytes�$UnquotingTests.test_unquote_to_bytes�s���4��8�����.�.�u�5�������"�F�,�	-����.�.�~�>��(�������"�F�,�	-���"�����.�.�u�5�������"�F�,�	-�
 ��"�����.�.�u�5�������"�F�,�	-rc�*�SnSn[RRU5nURX#SU<SU<35 [RRUSSS9nURX#SU<SU<35 [RRSSS9nSnURX#SU<SU<35 S	nS
n[RRU5nURX#SU<SU<35 SnSn[RRU5nURX#SU<SU<35 [RRUS
S9nURX#SU<SU<35 SnSn[RRUSS9nURX#SU<SU<35 [RRS5nSnURX#SU<SU<35 [RRSSS9nSnURX#SU<SU<35 g)Nr�ubrückner_sapporo_20050930.docr�rYr�zbr%FCckner_sapporo_20050930.docrgr�r�r�z%F3%B1u�rS)r�r)�ignorer�u漢üu漢%FC�rr�r�r�r�s    r�test_unquote_with_unicode�(UnquotingTests.test_unquote_with_unicode�s��4��5�����%�%�e�,�������8>��G�	I����%�%�e�d�4�%�H�������8>��G�	I����%�%�&G�/8�&�:��5�������8>��G�	I�%�������%�%�e�,�������8>��G�	I��������%�%�e�,�������8>��G�	I����%�%�e�I�%�>�������8>��G�	I��������%�%�e�H�%�=�������8>��G�	I����%�%�n�5���������8>��G�	I�
���%�%�k�I�%�F���������8>��G�	Irc�r�SnSn[RRU5nURX#SU<SU<35 SnSn[RRU5nURX#SU<SU<35 SnSn[RRU5nURX#SU<SU<35 g)	Nsblueberryjam�blueberryjamr�rYsblåbærsyltetøyublåbærsyltetøysbl%c3%a5b%c3%a6rsyltet%c3%b8jublåbærsyltetøjr�r�s    r�test_unquoting_with_bytes_input�.UnquotingTests.test_unquoting_with_bytes_input�s����������%�%�e�,�������8>��G�	I�7��0�����%�%�e�,�������8>��G�	I�1��0�����%�%�e�,�������8>��G�	Irr&N)rHrIrJrKr�r�r�r�r�r�r�r�r�r�rLr&rrr�r�6s<���(�*Q�"Z�H-�
N�
N�-�>8I�tIrr�c�`�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrg)�urlencode_TestsizTests for urlencode()c�(�/SQn[RRU5nUH!nURXTSU<SU<SU<35 M# UR	URS5SSU<SURS5<35 UR
S5nXFS-
nXFS-nURUR5=(a UR5SU<S	U<35 UR	[U5S
SU<S[U5<SS
<35 g
)z�Helper method for testing different input types.

'given' must lead to only the pairs:
    * 1st, 1
    * 2nd, 2
    * 3rd, 3

Test cannot assume anything about order.  Docs make no guarantee and
have possible dictionary input.

)z1st=1z2nd=2z3rd=3ztesting z: z not found in �&rz: expected 2 '&'s; got r
z%: '&' not located in proper place in �z#: unexpected number of characters: rYN)
rr��	urlencoder�r�r��indexr�isdigitr)	r.ry�	test_type�expect_somewhererrt�amp_location�on_amp_left�on_amp_rights	         r�help_inputtype�urlencode_Tests.help_inputtypes���7�����'�'��.��(�H��M�M�(�F�#�X�v�7�
8�)�	
������c�*�A�#�V�\�\�#�%6�8�	9��|�|�C�(���A�-�.���Q�.�/������+�+�-�H�,�2F�2F�2H����)�	*�	
����V��k�$�S��[�+�?�	@rc�0�URSSSS.S5 g)N�1�2�3)�1st�2nd�3rdzusing dict as input type�r�rFs r�test_using_mapping�"urlencode_Tests.test_using_mapping.s�����3�c��=�6�	8rc�,�UR/SQS5 g)N))r�r�)r�r�)r�r�z*using sequence of two-item tuples as inputr�rFs r�test_using_sequence�#urlencode_Tests.test_using_sequence3s�����F�H�	Jrc��SS0n[S5<S[S5<3n[RRU5nUR	X#5 SS0nSn[RRU5nUR	X#5 g)Nr��=zkey namezA bunch of pluseszkey+name=A+bunch+of+pluses)rrr�r�r�r�s    r�test_quoting�urlencode_Tests.test_quoting8sq���S�	��%�c�N�I�c�N�;�����'�'��.������(��/�0��-�����'�'��.������(rc��S/SQ0nS[RR[/SQ55-n[RR	U5nURX#5 [RR	US5nUSHnSU-nUR
X#5 M URURS5SSURS5-5 g)N�sequence)r�r�r�zsequence=%sTr�rzExpected 2 '&'s, got %s)rr�r\r�r�r�r�r�)r.ryrlr�values     r�
test_doseq�urlencode_Tests.test_doseqCs����O�,������!8�!8��_�9M�!N�N�����'�'��.������(����'�'��t�4���:�&�E�"�U�*�F��M�M�&�)�'�	
������c�*�A�2�V�\�\�#�5F�F�	Hrc��URS[RR055 URS[RR/55 gr��r�rr�r�rFs r�test_empty_sequence�#urlencode_Tests.test_empty_sequencePs@������V�\�\�3�3�B�7�8�����V�\�\�3�3�B�7�8rc���URS[RRSS055 URS[RRSS055 g)Nza=1�ar
za=Noner�rFs r�test_nonstring_values�%urlencode_Tests.test_nonstring_valuesTsH��������� 6� 6��Q�x� @�A�����6�<�<�#9�#9�3��+�#F�Grc�h�URS[RRSSS/0S55 URS[RRSSS/0S55 [R
"SS/5nURS	[RRSU0S55 g)
Nza=1&a=2r�r
rTz
a=None&a=a)r�r
)�br
za=a&a=b)r�rr�r�r#r$)r.r s  r�test_nonstring_seq_values�)urlencode_Tests.test_nonstring_seq_valuesXs�������F�L�L�$:�$:�C�!�Q��=�$�$O�P��������/�/��t�S�k�0B�D�I�	K��&�&��(�';�<���������/�/��d��T�B�	Drc�:�SnSn[RRUSSS9nURX#5 SnSn[RRU5nURX#5 SnSn[RRUSS	9nURX#5 g)
N�)� �Á�%3F=%3Fr�rSr��
%C2%A0=%C3%81�%A0=%C1rgr��rr�r�r�r�s    r�test_urlencode_encoding�'urlencode_Tests.test_urlencode_encoding`s���'�������'�'���	�'�R������(�(�� �����'�'��.������(�(�������'�'��	�'�B������(rc�|�SnSn[RRUSSSS9nURX#5 SnSn[RRUSSSS	9nURX#5 SnS
n[RRUS5nURX#5 SnSn[RRUS5nURX#5 SnS
n[RRUSSS9nURX#5 SnSn[RRUSSS9nURX#5 g)Nr�r�Tr�rS)�doseqrir�))r�)r
r�z
%3F=1&%3F=%3Fr�r�))r�)�*r�z%C2%A0=42&%C2%A0=%C3%81r�rgr�z%A0=42&%A0=%C1r�r�s    r�test_urlencode_encoding_doseq�-urlencode_Tests.test_urlencode_encoding_doseqss@��'�������'�'��T�18��(�L������(�-�� �����'�'��t�18��(�L������(�(�� �����'�'��t�4������(�-��*�����'�'��t�4������(�(�������'�'��t�i�'�H������(�-��!�����'�'��t�i�'�H������(rc�8�SnSn[RRU5nURX#5 [RRUS5nURX#5 SnSn[RRUS5nURX#5 g)N�)��$��$z
%A0%24=%C1%24T))r)rrz%A0%24=42&%A0%24=%C1%24r�r�s    r�test_urlencode_bytes�$urlencode_Tests.test_urlencode_bytes�s���-�� �����'�'��.������(����'�'��t�4������(�4��*�����'�'��t�4������(rc�T�Sn[RRUSS9nSnURX25 Sn[RRUSSS9nSnURX25 SnSn[RRUSSS9nURX25 Sn[RRUSS	S
9nSnURX25 SnSn[RRUSSS	S9nSnSn[RRUSSS	S
9nURX25 g)Nrz:$rez	%A0$=%C1$T)rrf))r)r�
rz%A0$=%C1$&%A0$=13&%A0$=42rg)rfri)rrfrir�)r.ryrrls    r�&test_urlencode_encoding_safe_parameter�6urlencode_Tests.test_urlencode_encoding_safe_parameter�s?��
.�����'�'��D�'�9��������(�-�����'�'��T��'�E��������(�9��,�����'�'��t�$�'�?������(�.�����'�'��D�1:�(�<��������(�-�������'�'��T��1:�(�<��9��,�����'�'��t�$�1:�(�<������(rr&N)rHrIrJrKr�r�r�r�r�r�r�r�r�r�rr	r
rLr&rrr�r�sH���@�@8�
J�
	)�H�9�H�D�)�&#)�J)�&)rr�c���\rSrSrSrSrSr\R"\	RS:HS5S5r\R"\	RS:HS5S	5r
\R"\RS
5S5r\R"\	RS:HS5S5r\R"\	RS:HS5S
5r\R"\RS
5S5rSrg)�Pathname_Testsi�z&Test pathname2url() and url2pathname()c�0�[RRSSSS5nSn[RRU5nUR
X#SU<SU<35 [RRU5nUR
XSU<SU<35 g)	N�parts�ofr�r�zparts/of/a/path�pathname2url() failed; rYzurl2pathame() failed; )r�r�r[rrrr��url2pathname)r.�
expected_path�expected_urlrs    rr�Pathname_Tests.test_basic�s��������W�d�C��@�
�(�����,�,�]�;������v� �,�0�	1����,�,�\�:������� �-�1�	2rc��[RRSSS5nS[RRS5-n[RRU5nURX#SU<SU<35 Un[RRU5nURX#SU<SU<35 [RRSS	5nS
[RRS5-n[RRU5nURX#SU<SU<35 Sn[RRSS
5n[RRU5nURX#SU<SU<35 g)N�needszquot=ing�herez
needs/%s/hererrYzurl2pathname() failed; z	make sure�using_quotez%s/using_quotezmake+sure/using_unquotez	make+sure�
using_unquote)
r�r�r[rr�r�rrr�rr�s    rr��Pathname_Tests.test_quoting�sD�������W�j�&�9�� �6�<�<�#5�#5�j�#A�A�����,�,�U�3������� �&�*�	+������,�,�V�4������� �&�*�	+������[�-�8��!�F�L�L�$6�$6�{�$C�C�����,�,�U�3������� �&�*�	+�*�������k�?�;�����,�,�U�3������� �&�*�	+r�win32z#test specific to Windows pathnames.c��[RRnURU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S	5S
5 URU"S5S5 URU"S
5S5 URU"S5S5 URU"S5S5 URU"S5S5 UR	[
US5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S 5S!5 URU"S"5S
5 URU"S5S5 URU"S#5S5 URU"S$5S5 /S%QnUH8nURU"[RR
U55U5 M: g)&Nz
\\?\C:\dirz	///C:/dirz\\?\unc\server\share\dirz//server/share/dir�C:�///C:�C:\�///C:/zC:\a\b.cz///C:/a/b.cz	C:\a\b.c\z///C:/a/b.c/z	C:\a\\b.cz///C:/a//b.cz	C:\a\b%#cz///C:/a/b%25%23cuC:\a\béz///C:/a/b%C3%A9�C:\foo\bar\spam.foo�///C:/foo/bar/spam.foozXX:\z
\folder\test\�
/folder/test/z\\folder\test\z//folder/test/z\\\folder\test\z///folder/test/z
\\some\share\z
//some/share/z\\some\share\a\b.cz//some/share/a/b.cu\\some\share\a\b%#céz//some/share/a/b%25%23c%C3%A9zC:/a/b.cz
//?/C:/dirz//?/unc/server/share/dir)r"r'r&)rrrr�r��IOErrorr)r.�fn�urlsrs    r�test_pathname2url_win�$Pathname_Tests.test_pathname2url_win�s���^�^�
(�
(������,�-�{�;�����<�=�?S�T�����D��7�+�����F��X�.�����L�)�=�9�����N�+�^�<�����N�+�^�<�����M�*�,>�?�����N�+�->�?�����4�5�7O�P����'�2�w�/�����.�/��A�����0�1�3C�D�����2�3�5F�G�����/�0�/�B�����5�6�8L�M�����:�;�=\�]�����J���7�����0�1�3G�H�����L�)�;�7�����6�7�9M�N�*���C����R���� ;� ;�C� @�A�3�G�rz test specific to POSIX pathnamesc�X�[RRnURU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S	5 g)
NrIz/a/b.cz//a/b.cz	////a/b.cz///a/b.cz
/////a/b.cz//////a/b.cz/a/b%#cz/a/b%25%23c)rrrr��r.r)s  r�test_pathname2url_posix�&Pathname_Tests.test_pathname2url_posixs����^�^�
(�
(������C��#�&�����H��x�0�����I���4�����J���6�����K��-�8�����I��
�6rzneed os_helper.FS_NONASCIIc�*�[R"5n[R"5n[RR[RXS9nUR[RR[R5U5 g�Nr�)�sys�getfilesystemencoding�getfilesystemencodeerrorsrr�r�r�FS_NONASCIIr�rr�r.rir�rs    r�test_pathname2url_nonascii�)Pathname_Tests.test_pathname2url_nonascii(sb���,�,�.���.�.�0���l�l� � ��!6�!6�� �Y��������4�4�Y�5J�5J�K�S�Qrc�j�[RRnURU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S	5S
5 URU"S5S5 URU"S
5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 UR	[
US5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S 5S5 URU"S!5S"5 URU"S#5S5 URU"S$5S%5 URU"S&5S'5 /S(QnUH8nURU"[RR
U55U5 M: g))Nz/C:/r#z///C|r!r"r$z/C|//zC:\\z
///C|/pathzC:\pathz
///C/test/z\C\test\z////C/test/z	\\C\test\zC:/path/to/filezC:\path\to\filezC:/path/to/file/zC:\path\to\file\zC:/path/to//filezC:\path\to\\filezC|/path/to/filez/C|/path/to/filez///C|/path/to/filez///C|/foo/bar/spam.foor%u///è|/z//server/path/to/filez\\server\path\to\filez////server/path/to/filez/////server/path/to/filez//localhost/C:/path/to/filez//localhost/C|/path/to/filez//localhost/path/to/filez
\path\to\filez //localhost//server/path/to/filezC:/foo%2fbarz
C:\foo/barz//server/share/foo%2fbarz\\server\share\foo/bar)r!z	\C\test\\r%)rrrr�r�r(r)r.r)�pathsr�s    r�test_url2pathname_win�$Pathname_Tests.test_url2pathname_win/sm���^�^�
(�
(������F��V�,�����G��d�+�����G��d�+�����H��v�.�����G��h�/�����L�)�:�6�����L�)�=�9�����M�*�O�<�����-�.�0D�E�����.�/�1G�H�����.�/�1G�H�����-�.�0D�E�����.�/�1E�F�����0�1�3G�H�����4�5�7O�P����'�2�}�5�����3�4�6R�S�����5�6�8T�U�����6�7�9U�V�����9�:�<P�Q�����9�:�<P�Q�����6�7�9K�L�����>�?�A]�^�����N�+�]�;�����6�7�9U�V�)���D����R���� ;� ;�D� A�B�D�I�rc�(�[RRnURU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 g)Nz/foo/barz	//foo/barz
///foo/barz////foo/barz//localhost/foo/bar)rrrr�r.s  r�test_url2pathname_posix�&Pathname_Tests.test_url2pathname_posixYs{���^�^�
(�
(������J���4�����K��+�6�����L�)�:�6�����M�*�K�8�����1�2�J�?rc��[R"5n[R"5n[RnUR[RRU5[R5 [RRX1US9nUR[RRU5[R5 gr2)r3r4r5rr6r�rrrr�r�r7s    r�test_url2pathname_nonascii�)Pathname_Tests.test_url2pathname_nonasciics����,�,�.���.�.�0���#�#��������4�4�S�9�9�;P�;P�Q��l�l� � ��� �G��������4�4�S�9�9�;P�;P�Qrr&N)rHrIrJrKr�rr�r�r�r3�platformr+�skipIfr/rr6r8r<r?rBrLr&rrrr�s!��0�2�+�6�������0�>�@� H�@� H�D�_�_�S�\�\�W�,�7�9�7�9�7�����.�.�0L�M�R�N�R��������0�>�@�&J�@�&J�P�_�_�S�\�\�W�,�7�9�@�9�@�����.�.�0L�M�R�N�Rrrc��\rSrSrSrSrSrg)�
Utility_Testsilz=Testcase to test the various utility functions in the urllib.c�h�UR[RR5[5 g)zATest the urllib.request.thishost utility function returns a tupleN)r�rr�thishost�tuplerFs r�
test_thishost�Utility_Tests.test_thishostos�����f�n�n�5�5�7��?rr&N)rHrIrJrKr�rKrLr&rrrGrGls��G�@rrGc��\rSrSrSrSr\R"\S9S5r	\R"\S9S5r
\R"\S9S5rSrg	)
�URLopener_Testsitz4Testcase to test the open method of URLopener class.c�N�"SS[RR5n[R"S[
45 UR
U"5RS5S5 UR
U"5RS5S5 SSS5 g!,(df   g=f)Nc��\rSrSrSrSrg)�8URLopener_Tests.test_quoted_open.<locals>.DummyURLopenerixc��U$r,r&�r.rs  r�	open_spam�BURLopener_Tests.test_quoted_open.<locals>.DummyURLopener.open_spamy����
rr&N)rHrIrJrKrTrLr&rr�DummyURLopenerrQx���
rrWz8DummyURLopener style of invoking requests is deprecated.zspam://example/ /z//example/%20/z,spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/z'//c:|windows%/:=&?~#+!$,;'@()*[]|/path/)rrr�rr$r%r�r)r.rWs  r�test_quoted_open� URLopener_Tests.test_quoted_openws���	�V�^�^�5�5�	��
+�
+�K�"�$�%�
���^�-�2�2�#�%�%5�
7�
���^�-�2�2�>�@�9�
;�%�%�%�s
�A
B�
B$)�categoryc���[R"5n[R"US9up#[R
"U5 S[RRU5-n[RR5RU5upVUR[RRU5[RRU55 SSS5 g!,(df   g=f)N)�dirzfile:)r�temp_dirr�r�r�rErrrr��retriever�r��normcase)r.�tmpdirr��tmpfile�fileurlr��_s       r�test_urlopener_retrieve_file�,URLopener_Tests.test_urlopener_retrieve_file�s���
�
�
�
!�V�"�*�*�v�6�K�B��H�H�R�L����� ;� ;�G� D�D�G� �.�.�2�2�4�=�=�g�F�K�H����R�W�W�-�-�h�7����9I�9I�'�9R�S�
"�
!�
!�s�C
C)�)
C7c�"�SnURS5 URUR5 [RR5R
U5up#UR[RRU5SS5 g)Nzhttp://www.python.org/file.txtr=r
z.txt)r_r�rirrr�r_r�r�r��splitext)r.rr�rds    r�test_urlopener_retrieve_remote�.URLopener_Tests.test_urlopener_retrieve_remote�sg��.���
�
�6�7�������(��n�n�.�.�0�9�9�#�>���������)�)�(�3�A�6��?rc�F�"SS[RR5nSH�nUR[[RR
U5 UR[[RR5RU5 UR[[RR5RU5 UR[U"5RU5 UR[U"5RU5 M� g)Nc��\rSrSrSrSrg)�<URLopener_Tests.test_local_file_open.<locals>.DummyURLopeneri�c��U$r,r&rSs  r�open_local_file�LURLopener_Tests.test_local_file_open.<locals>.DummyURLopener.open_local_file�rVrr&N)rHrIrJrKrorLr&rrrWrm�rXrrW)zlocal_file://examplezlocal-file://example)rrr�r�r�r"rr_)r.rWrs   r�test_local_file_open�$URLopener_Tests.test_local_file_open�s���	�V�^�^�5�5�	�D�C����g�v�~�~�'=�'=�s�C����g�v�~�~�'?�'?�'A�'F�'F��L����g�v�~�~�'?�'?�'A�'J�'J�C�P����g�~�'7�'<�'<�c�B����g�~�'7�'@�'@�#�F�Drr&N)
rHrIrJrKr�rYr�ignore_warningsr%rerirqrLr&rrrNrNtss��>�
;��$�$�.@�A�T�B�T��$�$�.@�A�@�B�@��$�$�.@�A�
G�B�
GrrNc�$�\rSrSrSrSrSrSrg)�RequestTestsi�z&Unit tests for urllib.request.Request.c���[RRnU"S5nURUR	5S5 U"S05nURUR	5S5 g)NrAr	�POST)rr�Requestr��
get_method�r.rxrs   r�test_default_values� RequestTests.test_default_values�s[���.�.�(�(���1�2������+�+�-�u�5��1�2�6������+�+�-�v�6rc���[RRnU"SSS9nURURS5 URUR5S5 U"S0SS9nURURS5 URUR5S5 U"SSS9nURUR5S5 SUlURUR5S5 g)NrA�HEAD)�methodr	)rrrxr�rryrzs   r�test_with_method_arg�!RequestTests.test_with_method_arg�s����.�.�(�(���1�&�A���������0�����+�+�-�v�6��1�2�f�E���������0�����+�+�-�v�6��1�%�@������+�+�-�u�5��������+�+�-�v�6rr&N)rHrIrJrKr�r{r�rLr&rrruru�s��0�7�7rru�__main__)NNrk)9r��urllib.parser�urllib.request�urllib.error�http.clientr\�
email.messager�r;r��
unittest.mockrr�r�test.supportrrrr�test.support.testcaser	r�r��ImportErrorr3r��base64r
r#�has_gethostname�SkipTestrrr"rr_r�rarm�TestCaser�r�r r2r�r�r@rSr�r�rrGrNrurH�mainr&rr�<module>r�s��A������	����"�&�(�.�1�	��������$�$�
�
�
�9�
:�:���
�
&� /�,�^<�F�<�;�6�;�(XR��)�)�?�XR�vD9��"�"�D9�N!C�� 1� 1�!C�HC'��)�)�=�,�C'�LSE��)�)�?�SE�jH-�H�-�-�H-�V*"�H�-�-�}�*"�ZJL�8�$�$�JL�ZRI�X�&�&�RI�jA)�h�'�'�A)�F\R�X�&�&�\R�|@�H�%�%�@�/G�m�X�%6�%6�/G�d7�8�$�$�7�0�z���M�M�O���U5��
�C��s�G4�4H�?H

Youez - 2016 - github.com/yon3zu
LinuXploit