403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.141
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:/Python315/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/__pycache__/test_fileinput.cpython-315.opt-2.pyc
R
>lqj`�c�n�]PHs]PHs]PHs]PHs]PHs]PHs]PHs]PHs]PH s]PH&s	]PH.s]QHGsG
s
]QHGsGs]QH@Gs]QHHGsGs]QHHGs]QH@Gs]QH`Gs]QH GsQ	Q
2sQQ2sQ
Q\\O:2sQQ2sQQ\\O:2s QQ2s!QQ\O:2s"QQ\"2s#QQ\"2s$QQ\"2s%QQ\"2s&QQ \"2s'Q!Q"\"2s(Q#Q$\"2s)Q%Q&\"2s*Q'Q(\"2s+Q)Q*2s,Q+Q,\O:2s-Q-Q.\O:2s.Q/Q0\O:2s/\0Q16Xc\Ob2P!P!\
cPs	CKxh9h\
cPsCK�h9h)2�)�BytesIO�StringIO)�	FileInput�hook_encoded)�verbose)�TESTFN�FakePath)�unlink)�	os_helper)�support)�mockc�0`�\sQs]'snQQ-QksQsUsP!)�	BaseTests�mode�wc��[O2vq4UO[OU2QU7cPLQo[V2UQ59^tt^2oUO
U2PPP2U!)%fhS!9h)�b�utf-8��encoding)�tempfile�mkstemp�
addCleanupr
r	�open�write)�self�contentr�fd�namer�fs&&$    �(C:\Python315\\Lib\test\test_fileinput.py�writeTmp�BaseTests.writeTmp*sf���#�#�%������	�(�(�$�/��$�;�4�G��
�"�X�
.�
.�!�
�G�G�G��/���/�
.���s�A5�5B	�>B	�)�__name__�
__module__�__qualname__�__firstlineno__r!�__static_attributes__�__classdictcell__��
__classdict__s@r rr's��������rc�X`�\sQs]2snQs\Q2sQsQQksQ	Qks	Qs
QsUsP!)
�
LineReaderc��,UmP!�N��
_linesread�rs&r �__init__�LineReader.__init__4s	����r,c�R�UOQ*,Um!,Smh9h):NNNr1r3s&r �	linesread�LineReader.linesread7s"��	!��?�?�1�%� �D�O��b�D�O�s��	&c�F�[UOP	22UmU!�T)�iter�
splitlines�it)r�filenamers&&&r �openhook�LineReader.openhook>s���x�*�*�4�0�1����r,c�j�[UOP2oUOOU2U!)�)�nextr=r2�append)r�size�lines&& r �readline�LineReader.readlineBs)���D�G�G�R� �������t�$��r,c��,o]oUO2oU%fU!UOU2U[U2*
oV16�fJFU!�r)rGrD�len)r�hint�linesrErFs&&   r �	readlines�LineReader.readlinesGsF��������=�=�?�D�����L�L����C��I��D��|��r,c��P!r0r#r3s&r �close�LineReader.closeSs��r,)r2r=r0)���)
r$r%r&r'r4�propertyr7r?rGrNrQr(r)r*s@r r.r.2s7������!��!���

�
�
r,r.c�(`�\sQs]VsnQsQsUsP!)�BufferSizesTestsc	�r�UOPOQ[]2222oUOPOQ[]
2222oUOPOQ[]2222oUOPOQ[]2222o[OQ2o[
%c[
Q2[VV41QQ5o[U2oUO2UO[U2]2UOU]*Q	2UOU]*Q
2UOUO2]2UOUO2U2[
%c[
Q2[VV41QQ5oQoU%cUQ
6wcUO2oJ!UOUO2U2UOUO2]2UOUO2]2UO!UO#22UO!UO%22[
%c[
Q2UO'2UOUO2Q2UOUO2]2UO2[
%c[
Q2[VV4Q1QQ5o[(O*o	[-Q2[(m[U2oUO[U2]!2UOU] *Q2UOUO2Q2UO'2U	[(m[
%c[
Q2[VV41QQ5oUOUO2]2UOUO2P2UO'2UOUO2]2UOUO2P2[
%c[
Q2[(O.o
[VV41P	QQ5oSFD!oUPPO12o[
U2J#	UO2U
[(m[VV41QQ5oSFDzoUOUP*Q2UO3UPP2oUO5UP2UO[7UO9]22UO22J|	UO2P!S	[(mh9hS
[(mh9h)rBc3�N�SF �DoQU]**w�	J	P!3h)zLine %s of file 1
r#��.0�is& r �	<genexpr>�5BufferSizesTests.test_buffer_sizes.<locals>.<genexpr>Y���)���)�Q�#8�A�a�C�#@�#@�)���%c3�N�SF �DoQU]**w�	J	P!3h)zLine %s of file 2
r#rYs& r r\r]Zr^r_c3�N�SF �DoQU]**w�	J	P!3h)zLine %s of file 3
r#rYs& r r\r][���(���(�Q�#8�A�a�C�#@�#@�(�r_c3�N�SF �DoQU]**w�	J	P!3h)zLine %s of file 4
r#rYs& r r\r]\rbr_zLINE (\d+) OF FILE (\d+)z1. Simple iterationr��filesrzLine 5 of file 1
zLine 1 of file 4
z2. Status variables�xzLine 6 of file 2
z3. NextfilezLine 1 of file 3
z4. Stdin�-z Line 1 of stdin
Line 2 of stdin
zLine 2 of stdin
z<stdin>z5. Boundary conditionsz
6. Inplace�re�inplacer�
)r!�join�range�re�compiler�printr�listrQ�assertEqualrK�linenor>rG�
filelineno�assertFalse�isfirstline�isstdin�nextfile�sys�stdinr�stdout�upper�match�assertNotEqual�int�group)
r�t1�t2�t3�t4�pat�firM�s�	savestdin�
savestdoutrF�ms
&            r �test_buffer_sizes�"BufferSizesTests.test_buffer_sizesWs0��
�]�]�2�7�7�"T�%�PR�)�"T�T�
U��
�]�]�2�7�7�"T�%�PR�)�"T�T�
U��
�]�]�2�7�7�"S�%�PQ�(�"S�S�
T��
�]�]�2�7�7�"S�%�PQ�(�"S�S�
T���j�j�4�5���7��'�(�
�b�b�-��
@���R���
���
�����U��R�(�����q��#7�8�����r��$8�9��������b�)���������+��7��'�(�
�b�b�-��
@�����A�-�-����
�A���������+��������b�)��������!�,�������)�*��������&��7��-� �
���
��������(<�=��������b�)�
���
��7��*��
�b�b�c�2�W�
E���I�I�	�	"� �!E�F�C�I���H�E����S��Z��,����U�2�Y�(;�<����R�[�[�]�I�6��K�K�M�!�C�I��7��*�+�
�b�b�-��
@���������a�(���������-�
���
��������a�(���������-��7��,���Z�Z�
�	$��"�"�!1�4�'�R�B����C�R�y���(���d���
�H�H�J�#�C�J�
�b�b�-��
@���D����T�"�X�t�,��	�	�$�s��)�$�A�����4�(����S������_�b�m�m�o�>�	�
	���
��;"�C�I��*$�C�J�s�8BV�$AV)�
V&�)
V6r#)r$r%r&r'r�r(r)r*s@r rVrVVs����P�Pr,rVc�.`�\sQs]�snQsQsQsUsP!)�UnconditionallyRaisec�"�VmP
UmP!�F��exception_type�invoked)rr�s&&r r4�UnconditionallyRaise.__init__�s��,����r,c�2�P	UmUO2gr:)r�r��r�args�kwargss&*,r �__call__�UnconditionallyRaise.__call__�s������!�!�#�#r,r��r$r%r&r'r4r�r(r)r*s@r r�r��s�����$�$r,r�c�`�\sQs]�snQsQsQsQsQsQs	Qs
QsQ	sQ
s
QsQsQ
sQsQsQsQsQsQsQsQsQsQsQsUsP!)�FileInputTestsc���UOP2oUOP2oUOQ2oUOP2o[VV41QQ5oUO2oUOUQ2UOUO	2]2UOUO2]2UOUO
2U2UO2oUOU2UOUO	2]2UOUO2]2UOUO
2U2UO2P!)rBzThe only line there is.
rrd)	r!rrGrqrrrsr>rtrQ)rr�r�r�r�r�rFs&      r �test_zero_byte_files�#FileInputTests.test_zero_byte_files�s��
�]�]�2�
��
�]�]�2�
��
�]�]�6�
7��
�]�]�2�
��
�b�b�-��
@���{�{�}������:�;��������a�(��������!�,���������+��{�{�}��������������a�(��������!�,���������+�
���
r,c�&�UOQ2oUOQ2o[V1QQ5o[U2oUOU,QN2UOUO	2]2UOUO2]2P!)�A
B
C�D
E
Frrd��A
�B
�CzD
zE
�F)r!rrprqrsrr�rr�r�r�rMs&    r �%test_files_that_dont_end_with_newline�4FileInputTests.test_files_that_dont_end_with_newline�sr��
�]�]�9�
%��
�]�]�9�
%��
�b�X��
8���R������� F�G��������!�,��������a�(r,c��UOQ2oUOQ2o[V1QQ5oUOUO2P2[	U2oUOUO2P2UO
2UOUO2P2[U2oUOUO2P2P!)zA
BzC
Drrd)r!rrq�filenorCr}rwrp)rr�r�r�rFs&    r �test_fileno�FileInputTests.test_fileno�s���
�]�]�6�
"��
�]�]�6�
"��
�b�X��
8���������b�)��B�x�����B�I�I�K��,�
���
��������b�)��B�x���������b�)r,c��QFDXoUOUQ59^tt^2UO[29^tt^2[UQ5PPP2PPP2JZ	P!)%fhK9h)%fhJ�9h)r�r)r�rU�U)�subTest�assertRaises�
ValueErrorr)rrs& r �test_invalid_opening_mode�(FileInputTests.test_invalid_opening_mode�sV��$�D����4��(�(��&�&�z�2�2��4�(�3�)�(�%�2�2��)�(�(�s/�A6	�
A#
�
A6	�#A3�,A3�.A6	�6B
�?B
c��[OQ29^tt^2o[Q2Um[	Q,QQ5o[U2oUO
UQ,2PPP2P!)%fhP!9h)z	sys.stdin�spam, bacon, sausage, and spamrg�rb�rer)r�patchr�bufferrrprq)r�m_stdinr�rMs&   r �test_stdin_binary_mode�%FileInputTests.test_stdin_binary_mode�sZ��
�Z�Z��
$�
$��$�%F�G�G�N��#��T�2�B���H�E����U�%F�$G�H�	%�
$�
$�
$�s�=A'�'A8	�0A8	c� �[Oo[Q2[mUO[OQ2[	Q,QQ5o[U2oUO
UQ,2U[mP!S[mh9h)r�r�rgr�r�)rxryr�assertNotHasAttrrrprq)r�
orig_stdinr�rMs&   r �test_detached_stdin_binary_mode�.FileInputTests.test_detached_stdin_binary_mode�sk���Y�Y�
�	#�� A�B�C�I��!�!�#�)�)�X�6��#��T�2�B���H�E����U�%F�$G�H�"�C�I��
�C�I�s�A B�
B
c���[P	QQ5oUOQ2[]Q5oUOQ2QQ2oUOQ2oU2o[U,UQ59^tt^2oUO	2PPP2UOUOQ	2P![cK�h9h[cK�h9h)%fhKP9h)
Tc��P!r0r#)rr�s&&r �<lambda>�7FileInputTests.test_file_opening_hook.<locals>.<lambda>s��tr,)rir?zGFileInput should raise if both inplace and openhook arguments are given�r?z2FileInput should check openhook for being callablec�.`�\sQsQsnQsQsQsUsP!)�=FileInputTests.test_file_opening_hook.<locals>.CustomOpenHook�
c��P
UmP!r��r�r3s&r r4�FFileInputTests.test_file_opening_hook.<locals>.CustomOpenHook.__init__s	��$��r,c�*�P	Um[UQQ-!)Trr)r�r)rr��kargss&*,r r��FFileInputTests.test_file_opening_hook.<locals>.CustomOpenHook.__call__s��#����T�4�G�4�4r,r�r�r*s@r �CustomOpenHookr�
s����
%�
5�
5r,r�rjzopenhook not invoked)r�failr�r!rG�
assertTruer�)rr�r��t�custom_open_hooks&    r �test_file_opening_hook�%FileInputTests.test_file_opening_hook�s���	��4�2C�D�B��I�I�@�
A�	��A�&�B��I�I�J�K�	5�	5�
�M�M�$���)�+��
��s�%5�
6�
6�"��K�K�M�7����(�0�0�2H�I��'�	��	��
�	��	��7�
6�s@�B/�C�8C�/	B=�9B=�<B=�	C�
C�
C�C!	�C!	c	��[[Q29^tt^2oUOQ2UOQQ*2UOQ2PPP2UO[[2[[[
Q2Q59^tt^2oUOUO2Q2UOUO2Q2UOUO2Q	2UO[29^tt^2[U2PPP2UOUO2P2UOUO2P2PPP2P!)%fhCK*9h[cSOQ
2K�h9h)%fhK�9h)%fhP!9h)�wbsA
B
C
s
123456789
�����ascii�rer?r�r��C
zRead to end of file)
rrrr�safe_unlinkrrrqrG�UnicodeDecodeErrorr�r�rp�rrr�s&  r �
test_readline�FileInputTests.test_readlinesH��
�&�$�
�
�1�
�G�G�N�#�
�G�G�N�T�)�*�
�G�G�G�� �	
����V�,�
�V� ,�W� 5�7�7�:<�
1�� � ������6�� � ������6�� � ������6��"�"�#5�6�6��R��7�
���R�[�[�]�B�/����R�[�[�]�B�/�7�7� �
�
��&�
1��	�	�/�0�
1��6�6��7�7�7�sm�;E6�F?�A F
�;F?�F,	�$AF?�6F	�?F	�
	F)�F)�&F?�(F)�)F?�,F<
�5F<
�7F?�?G	�G	c�r�[[Q29^tt^2oUOQ2PPP2UO[[2[[QQ59^tt^2oUO
UO2Q2UO
UO2Q2UO
UO2Q2UO
UO2Q2UO
UO2Q2PPP2P!)%fhK�9h)%fhP!9h)r�sA
B
C
Dr�r�sA
sB
sC
Dr,)rrrrr�rrqrGr�s&  r �test_readline_binary_mode�(FileInputTests.test_readline_binary_mode1s���
�&�$�
�
�1�
�G�G�O�$� �����V�,�
�V�$�
/�
/�2����R�[�[�]�F�3����R�[�[�]�H�5����R�[�[�]�G�4����R�[�[�]�C�0����R�[�[�]�C�0�
0�
/�	 �
��0�
/�
/�s$�D�'B!D%�D"	�D"	�%D6	�.D6	c��UOQQQ5o[UQP	Q59^tt^2oUO2oUOUQ2[O
O
Q2PPP2[UQ29^tt^2oUOUO2Q2PPP2P!)%fhKO9h)%fhP!9h)s
Initial text.r�r�r�)rris	New line.)	r!rrGrqrxrzrr�read�r�	temp_file�fobjrFrs&    r �test_inplace_binary_write_mode�-FileInputTests.test_inplace_binary_write_mode>s����M�M�"2��M�>�	�
�y�t�T�
:�
:�d��=�=�?�D����T�#3�4��J�J���\�*�	;�
�)�T�
"�
"�a����Q�V�V�X�|�4�#�
"�;�
:��
#�
"�
"�s$�AB4�	!C�4C	�=C	�C	�C	c��UOQQQ5o[UP	QQQ59^tt^2oUO2oUOUQ2[	Q2PPP2[UQ29^tt^2oUOUO
2OQ	2Q
2PPP2P!)%fhK^9h)%fhP!9h)sInitial text �r�r�r��replace)rir�errorsuInitial text �uNew line ˆr�s
s
New line ?)r!rrGrqrorr��rstripr�s&    r �test_inplace_encoding_errors�+FileInputTests.test_inplace_encoding_errorsHs����M�M�"6�T�M�B�	�
�y�$� '�	�;�;�>B��=�=�?�D����T�#8�9��/�"�	;�
�)�T�
"�
"�a����Q�V�V�X�_�_�W�5�}�E�#�
"�;�;��
#�
"�
"�s#�.B0�60C�0C	�9C	�C	�C	c���QoUOQ2o[U,UQ59^tt^2oUO2oPPP2UOWQ2P!)%fhK$9h)c�0�[OQ2!)�(I used to receive only filename and mode)�ior�r>rs&&r �old_hook�FFileInputTests.test_file_hook_backward_compatibility.<locals>.old_hookSs���;�;�I�J�Jr,rjr�r�)r!rrGrq)rr�r�r��results&    r �%test_file_hook_backward_compatibility�4FileInputTests.test_file_hook_backward_compatibilityRsQ��	K��M�M�$���
��s�X�
.�
.�"��[�[�]�F�/�����!K�L�/�
.�s�A�A)	�"A)	c��UOQ2oUOQ2o[V1QQ59^tt^2o[U2oPPP2UOW,QN2UOWO	2]2UOUO2]2UOUOQ2P!)%fhK�9h)r�r�rrdr�r#)r!rrprqrsrr�_filesr�s&    r �test_context_manager�#FileInputTests.test_context_managerZs���
�]�]�9�
%��
�]�]�9�
%��
�b�X��
8�
8�B���H�E�9����� F�G��������!�,��������a�(�������B�'�9�
8�s�C�C	�	C	c���UOP2o[UQQ59^tt^2o[g)%fhP!9h[c!SOWOQ2P!h9h)rBrrdr#)r!r�OSErrorrqr)rr�r�s&  r �test_close_on_exception�&FileInputTests.test_close_on_exceptiondsW��
�]�]�2�
��	,���g�6�6�"��
�7�6�6���	,����R�Y�Y��+�	,�s0�A�0�A	�A	�A�A�	A/�A/�.A/c��[,QQ59^tt^2oUOUOQ2PPP2P!)%fhP!9h)rrd)rg)rrqr)rr�s& r �.test_empty_files_list_specified_to_constructor�=FileInputTests.test_empty_files_list_specified_to_constructorls4��
�R�'�
2�
2�b����R�Y�Y��/�3�
2�
2�
2�s�>�A	�A	c���[Oo[[2oUO	Q2oUO[UQ*2[U,P	QQ59^tt^2o[U2U[mUO2PPP2U[mUOUOQ2P!)%fhK99hS[mh9h)rjz.bakrrhzos.unlink() was not invoked)�osr	r�rr!rr�rrCrwr�r�)r�os_unlink_orig�os_unlink_replacementr�r�s&    r �%test_nextfile_oserror_deleting_backup�4FileInputTests.test_nextfile_oserror_deleting_backupps���
���� 4�W� =��	'��
�
�d�#�A��O�O�K��V��4��!��d�W�E�E���R��1��	����
�F�
'�B�I�	
���-�5�5�5�	7�F�E��
'�B�I�s*�AC�''B?�C�?C	�C	�
C�
Cc�t�[Oo[[2oUO	Q2o[U,P	QQ59^tt^2oU[mUO
2PPP2U[mUOUOQ2P!)%fhK99hS[mh9h�rjrrhzos.fstat() was not invoked)	r
�fstatr�rr!rrGr�r�)r�
os_fstat_orig�os_fstat_replacementr�r�s&    r �%test_readline_os_fstat_raises_OSError�4FileInputTests.test_readline_os_fstat_raises_OSError�������
�3�G�<��	%��
�
�d�#�A��!��d�W�E�E��/������
�F�%�B�H�	
���,�4�4�4�	6�F�E��%�B�H��)�(B*�
B�&B*�B'	� B'	�"B*�*
B7c�t�[Oo[[2oUO	Q2o[U,P	QQ59^tt^2oU[mUO
2PPP2U[mUOUOQ2P!)%fhK99hS[mh9hr)	r
�chmodr�rr!rrGr�r�)r�
os_chmod_orig�os_chmod_replacementr�r�s&    r �%test_readline_os_chmod_raises_OSError�4FileInputTests.test_readline_os_chmod_raises_OSError�rrc��QQ[2oU2oUOQ2o[U,QQ59^tt^2oUOoV$mUO	2oVTmPPP2UOUOQ2UOWPQ2P!XTmh9h)%fhKL9h)c�.`�\sQsQsnQsQsQsUsP!)�QFileInputTests.test_fileno_when_ValueError_raised.<locals>.FilenoRaisesValueError�c�<�[OU[2P!r0)r�r4r�r3s&r r4�ZFileInputTests.test_fileno_when_ValueError_raised.<locals>.FilenoRaisesValueError.__init__�s��$�-�-�d�J�?r,c�(�UO2P!r0)r�r3s&r r��XFileInputTests.test_fileno_when_ValueError_raised.<locals>.FilenoRaisesValueError.fileno�s���
�
�r,r#)r$r%r&r'r4r�r(r)r*s@r �FilenoRaisesValueErrorr#�s����
@�
 �
 r,r)rjrrdz_file.fileno() was not invokedzfileno() should return -1)r�r!r�_filer�r�r�rq)rr)� unconditionally_raise_ValueErrorr�r��file_backupr�s&      r �"test_fileno_when_ValueError_raised�1FileInputTests.test_fileno_when_ValueError_raised�s���	 �%9�	 �,B�+C�(��M�M�$���
�a�S�7�
3�
3�r��(�(�K�
'�;�������&��
4�	
���8�@�@�8�	:�	
�����%@�A��
'���
4�
3�s)�
B.�
B#�#B.�#B+�+B.�.B>	�7B>	c�2�[2o[QQ,UOQ59^tt^2oUOUO,2UOUO2Q2UOUOQ,2UOUO2Q2UOUOQ,2UOUO2Q2UOUOPQ,2UOUO2P2UOUOP,2UOUO2P2UOUO,2PPP2P!)%fhP!9h�zline1
line2zline3
r�zline1
�line2)r.rr?rqr7rG�r�srcr�s&  r �test_readline_buffering�&FileInputTests.test_readline_buffering�s,���l��
�n�i�8� #���.�.�13����S�]�]�B�/����R�[�[�]�I�6����S�]�]�Y�K�8����R�[�[�]�G�4����S�]�]�W�I�6����R�[�[�]�I�6����S�]�]�R��O�<����R�[�[�]�B�/����S�]�]�R�D�1����R�[�[�]�B�/����S�]�]�B�/�.�.�.�.�s�EF�F	�F	c��[2o[QQ,UOQ59^tt^2oUOUO,2UO[U2Q2UOUOQ,2UO[U2Q2UOUOQ,2UO[U2Q2UOUOPQ,2UO
[[
U2UOUOP,2UO
[[
U2UOUO,2PPP2P!)%fhP!9hr0)r.rr?rqr7rCr��
StopIterationr2s&  r �test_iteration_buffering�'FileInputTests.test_iteration_buffering�s���l��
�n�i�8� #���.�.�13����S�]�]�B�/����T�"�X�y�1����S�]�]�Y�K�8����T�"�X�w�/����S�]�]�W�I�6����T�"�X�y�1����S�]�]�R��O�<����m�T�2�6����S�]�]�R�D�1����m�T�2�6����S�]�]�B�/�.�.�.�.�s�D5E,�,E=	�5E=	c���[UOQ22o[UQQ59^tt^2oUO2oUO	UQ2UO	UO2]2UO	UO
2]2UO	UO2[OU22PPP2P!)%fhP!9h)�Path-like file.rr)
rr!rrGrqrrrsr>r
�fspath)rr�r�rFs&   r �test_pathlike_file�!FileInputTests.test_pathlike_file�s���
�d�m�m�$5�6�
7��
�r�G�
,�
,���;�;�=�D����T�#4�5����R�Y�Y�[�!�,����R�]�]�_�a�0����R�[�[�]�B�I�I�b�M�:�-�
,�
,�
,�s�BC�C#	�C#	c��[UOQ22o[UP	QQ59^tt^2oUO2oUO	UQ2[QU*2PPP2[
UQQ59^tt^2oUO	UO2Q2PPP2P!)%fhKP9h)%fhP!9h)r;r)rirzModified %srzModified Path-like file.
)rr!rrGrqrorr�)rr�r�rFrs&    r �test_pathlike_file_inplace�)FileInputTests.test_pathlike_file_inplace�s���
�d�m�m�$5�6�
7��
�r�4�'�
:�
:�b��;�;�=�D����T�#4�5��-�$�&�'�;��"�w�
'�
'�1����Q�V�V�X�'C�D�(�
'�	;�
:��(�
'�
'�s#�5B/�!C�/B?	�8B?	�C	�C	r#)r$r%r&r'r�r�r�r�r�r�r�r�r�r�r�r�rrr
rrrr-r4r8r=r@r(r)r*s@r r�r��s������()�(
*�)�I�	#�J�60�.1�5�F�M�(�,�0�7�*6�$6�$B�.0� 0� ;�E�Er,r�c	�p`�\sQsQsnQQQQPQPQP-QkksQsQ	sQ
sQsQs	Q
s
QsQsQs
UsP!)�
MockFileInput��r�rr?rr�c��VmV mV0mV@mVPmV`mVpmPUm[OQ2Um
-UmP!)Nc��]!rJr#r#r,r r��(MockFileInput.__init__.<locals>.<lambda>s��r,)reri�backuprr?rr�r*�collections�defaultdict�invocation_counts�
return_values)rrerirIrr?rr�s&&&&$$$$r r4�MockFileInput.__init__�sG���
������	� �
� �
�����
�!,�!8�!8��!C�����r,c�F�UOQ99*]*
tt$P!�rQ)rLr3s&r rQ�MockFileInput.closes�����w�'�1�,�'r,c�h�UOQ99*]*
tt$UOQ*!�rw�rLrMr3s&r rw�MockFileInput.nextfile�)�����z�*�a�/�*��!�!�*�-�-r,c�h�UOQ99*]*
tt$UOQ*!�r>rTr3s&r r>�MockFileInput.filename
rVr,c�h�UOQ99*]*
tt$UOQ*!�rrrTr3s&r rr�MockFileInput.lineno�)�����x�(�A�-�(��!�!�(�+�+r,c�h�UOQ99*]*
tt$UOQ*!�rsrTr3s&r rs�MockFileInput.filelinenos)�����|�,��1�,��!�!�,�/�/r,c�h�UOQ99*]*
tt$UOQ*!�r�rTr3s&r r��MockFileInput.filenor]r,c�h�UOQ99*]*
tt$UOQ*!�rurTr3s&r ru�MockFileInput.isfirstlines)�����}�-��2�-��!�!�-�0�0r,c�h�UOQ99*]*
tt$UOQ*!�rvrTr3s&r rv�MockFileInput.isstdins)�����y�)�Q�.�)��!�!�)�,�,r,)
r*rIrr�rerirLrr?rM)NFrB)r$r%r&r'r4rQrwr>rrrsr�rurvr(r)r*s@r rCrC�sW���� �� �$(� �37� �@D� �-�.�.�,�0�,�1�-�-r,rCc�4`�\sQsQsnQsQsQsQsUsP!)�BaseFileInputGlobalMethodsTest�"c�z�[OUm[OUm[
[mP!r0)�	fileinput�_state�_orig_stater�_orig_FileInputrCr3s&r �setUp�$BaseFileInputGlobalMethodsTest.setUp&s&��$�+�+���(�2�2���+�	�r,c�\�UO[mUO[mP!r0)rqrnrrpror3s&r �tearDown�'BaseFileInputGlobalMethodsTest.tearDown+s��"�2�2�	���+�+�	�r,c��UOU*oUOU]U2[UO2oUOU]2P!)�)rLrqrK)r�mock_file_input�method_name�actual_count�actual_total_counts&&&  r �assertExactlyOneInvocation�9BaseFileInputGlobalMethodsTest.assertExactlyOneInvocation/sF��&�8�8��E������q�+�6� ��!B�!B�C�����+�Q�/r,)rqrp)	r$r%r&r'rrrur}r(r)r*s@r rkrk"s����,�
,�0�0r,rkc�:`�\sQsQsnQsQsQsQsQsUs	P!)�Test_fileinput_input�7c�z�[2o[2UmU[mUO[29^tt^2o[O2PPP2UOQWOO2UOU[OQ2P!)%fhKY9h)N�fileinput._state)zinput() already active)rC�objectr*rnror��RuntimeError�inputrq�	exceptionr��assertIs)r�instance�cms&  r �1test_state_is_not_None_and_state_file_is_not_None�FTest_fileinput_input.test_state_is_not_None_and_state_file_is_not_None:sy��
!�?������#�	��
�
�
�|�
,�
,���O�O��-����4�b�l�l�6G�6G�H��
�
�h�	� 0� 0�2D�E�-�
,�s�B*�*B:	�3B:	c�`�[2oPUmU[mUO	2P!r0)rCr*rnro�do_test_call_input�rr�s& r �-test_state_is_not_None_and_state_file_is_None�BTest_fileinput_input.test_state_is_not_None_and_state_file_is_NoneGs&��!�?�����#�	�����!r,c�>�P[mUO2P!r0)rnror�r3s&r �test_state_is_None�'Test_fileinput_input.test_state_is_NoneRs�� �	�����!r,c	��[2o[2o[2o[2o[2o[2o[OVUVEUQ5oUOU[OQ2UOVO
Q2UOV'OQ2UOV7OQ2UOVGOQ2UOVWOQ2P!))rerirIrr?rr�rerirIrr?)
r�rnr�r�rorerirIrr?)rrerirIrr?rr�s&       r r��'Test_fileinput_input.do_test_call_input[s���
����(������x���8���8�����u�f��8�=��	
�
�
�f�i�.�.�0B�C�	
�
�
�e�\�\�7�3��
�
�g�~�~�y�9��
�
�f�m�m�X�6��
�
�d�K�K��0��
�
�h����<r,r#)
r$r%r&r'r�r�r�r�r(r)r*s@r r�r�7s����F�	"�"�=�=r,r�c�.`�\sQsQsnQsQsQsUsP!)�Test_fileinput_close�vc��P[m[O2UO[O2P!r0)rnrorQ�assertIsNoner3s&r r��'Test_fileinput_close.test_state_is_Noneys*�� �	���������)�*�*�+r,c��[2oU[m[O2UO	UQ2UO[O2P!rP)rCrnrorQr}r�r�s& r �test_state_is_not_None�+Test_fileinput_close.test_state_is_not_None�sA��!�?��#�	�������'�'��'�:����)�*�*�+r,r#�r$r%r&r'r�r�r(r)r*s@r r�r�vs����,�,�,r,r�c�.`�\sQsQsnQsQsQsUsP!)�Test_fileinput_nextfile�c�D�P[mUO[29^tt^2o[O2PPP2UOQWOO2UO[O2P!)%fhKW9h�N)zno active input())	rnror�r�rwrqr�r�r��rr�s& r r��*Test_fileinput_nextfile.test_state_is_None��h�� �	��
�
�
�|�
,�
,����� �-����/����1B�1B�C����)�*�*�+�-�
,���B�B	�B	c��[2o[2oVOQ$U[m[O
2oUO
UQ2UOV12UO[OU2P!rS)r�rCrMrnrorwr}r�)r�nextfile_retvalr��retvals&   r r��.Test_fileinput_nextfile.test_state_is_not_None��f��
!�(�� �?��-<���z�*�#�	���#�#�%���'�'��*�=��
�
�f�.��
�
�i�&�&��1r,r#r�r*s@r r�r�������,�2�2r,r�c�.`�\sQsQsnQsQsQsUsP!)�Test_fileinput_filename�c�D�P[mUO[29^tt^2o[O2PPP2UOQWOO2UO[O2P!)%fhKW9hr�)	rnror�r�r>rqr�r�r�r�s& r r��*Test_fileinput_filename.test_state_is_None�r�r�c��[2o[2oVOQ$U[m[O
2oUO
UQ2UOV12UO[OU2P!rX)r�rCrMrnror>r}r�)r�filename_retvalr�r�s&   r r��.Test_fileinput_filename.test_state_is_not_None�r�r,r#r�r*s@r r�r��r�r,r�c�.`�\sQsQsnQsQsQsUsP!)�Test_fileinput_lineno�c�D�P[mUO[29^tt^2o[O2PPP2UOQWOO2UO[O2P!)%fhKW9hr�)	rnror�r�rrrqr�r�r�r�s& r r��(Test_fileinput_lineno.test_state_is_None��h�� �	��
�
�
�|�
,�
,������-����/����1B�1B�C����)�*�*�+�-�
,�r�c��[2o[2oVOQ$U[m[O
2oUO
UQ2UOV12UO[OU2P!r[)r�rCrMrnrorrr}r�)r�
lineno_retvalr�r�s&   r r��,Test_fileinput_lineno.test_state_is_not_None�sf��
��
� �?��+8���x�(�#�	���!�!�#���'�'��(�;��
�
�f�,��
�
�i�&�&��1r,r#r�r*s@r r�r��r�r,r�c�.`�\sQsQsnQsQsQsUsP!)�Test_fileinput_filelineno��c�D�P[mUO[29^tt^2o[O2PPP2UOQWOO2UO[O2P!)%fhKW9hr�)	rnror�r�rsrqr�r�r�r�s& r r��,Test_fileinput_filelineno.test_state_is_None�sh�� �	��
�
�
�|�
,�
,��� � �"�-����/����1B�1B�C����)�*�*�+�-�
,�r�c��[2o[2oVOQ$U[m[O
2oUO
UQ2UOV12UO[OU2P!r_)r�rCrMrnrorsr}r�)r�filelineno_retvalr�r�s&   r r��0Test_fileinput_filelineno.test_state_is_not_None�sg��
#�H�� �?��/@���|�,�#�	���%�%�'���'�'��,�?��
�
�f�0��
�
�i�&�&��1r,r#r�r*s@r r�r��r�r,r�c�.`�\sQsQsnQsQsQsUsP!)�Test_fileinput_fileno�c�D�P[mUO[29^tt^2o[O2PPP2UOQWOO2UO[O2P!)%fhKW9hr�)	rnror�r�r�rqr�r�r�r�s& r r��(Test_fileinput_fileno.test_state_is_None�r�r�c��[2o[2oVOQ$VmU[m[O2oUOUQ2UOV12UO[O
U2P!rb)	r�rCrM�
fileno_retvalrnror�r}r�)rr�r�r�s&   r r��,Test_fileinput_fileno.test_state_is_not_Nonesl��
��
� �?��+8���x�(�!.��#�	���!�!�#���'�'��(�;��
�
�f�,��
�
�i�&�&��1r,r#r�r*s@r r�r��s����,�
2�
2r,r�c�.`�\sQsQsnQsQsQsUsP!)�Test_fileinput_isfirstline�c�D�P[mUO[29^tt^2o[O2PPP2UOQWOO2UO[O2P!)%fhKW9hr�)	rnror�r�rurqr�r�r�r�s& r r��-Test_fileinput_isfirstline.test_state_is_Nonesh�� �	��
�
�
�|�
,�
,���!�!�#�-����/����1B�1B�C����)�*�*�+�-�
,�r�c��[2o[2oVOQ$U[m[O
2oUO
UQ2UOV12UO[OU2P!re)r�rCrMrnrorur}r�)r�isfirstline_retvalr�r�s&   r r��1Test_fileinput_isfirstline.test_state_is_not_Nonesg��
$�X�� �?��0B���}�-�#�	���&�&�(���'�'��-�@��
�
�f�1��
�
�i�&�&��1r,r#r�r*s@r r�r�r�r,r�c�.`�\sQsQsnQsQsQsUsP!)�Test_fileinput_isstdin�,c�D�P[mUO[29^tt^2o[O2PPP2UOQWOO2UO[O2P!)%fhKW9hr�)	rnror�r�rvrqr�r�r�r�s& r r��)Test_fileinput_isstdin.test_state_is_None/sh�� �	��
�
�
�|�
,�
,������-����/����1B�1B�C����)�*�*�+�-�
,�r�c��[2o[2oVOQ$U[m[O
2oUO
UQ2UOV12UO[OU2P!rh)r�rCrMrnrorvr}r�)r�isstdin_retvalr�r�s&   r r��-Test_fileinput_isstdin.test_state_is_not_None9sf��
 ��� �?��,:���y�)�#�	���"�"�$���'�'��)�<��
�
�f�-��
�
�i�&�&��1r,r#r�r*s@r r�r�,r�r,r�c�.`�\sQsQsnQsQsQsUsP!)�InvocationRecorder�Gc��]UmP!rJ)�invocation_countr3s&r r4�InvocationRecorder.__init__Is
�� !��r,c�r�U9O]*
tmV1Um[OQ2!)rxs
some bytes)r��last_invocationr�rr�s&*,r r��InvocationRecorder.__call__Ls,������"�� $�~����z�z�-�(�(r,)r�r�r�r*s@r r�r�Gs����"�)�)r,r�c�`�\sQsQsnQsQsQs\O\	Q2Q2s
\O\	Q2Q2s\O\Q2Q	2s
Q
sQsQsQ
sQsQsQs\Q2sQsUsP!)�Test_hook_compressed�Rc�&�[2UmP!r0)r��	fake_openr3s&r rr�Test_hook_compressed.setUpUs��+�-��r,c�,�UOPQ2P!)rBrE��do_test_use_builtin_open_textr3s&r �test_empty_string�&Test_hook_compressed.test_empty_stringXs���*�*�2�s�3r,c�,�UOQQ2P!��abcdrEr�r3s&r �test_no_ext� Test_hook_compressed.test_no_ext[����*�*�6�3�7r,zRequires gzip and zlibc�T�[OoUO[m[OQQ2oU[mUOUOO]2UOUOOQ-12P!S[mh9h)�test.gzrE)r�rE)�gziprr�rn�hook_compressedrqr�r��r�
original_openr�s&  r �test_gz_ext_fake�%Test_hook_compressed.test_gz_ext_fake^sy���	�	�
��N�N��	�	&��.�.�y�#�>�F�%�D�I�������8�8�!�<�������7�7�:J�B�9O�P��&�D�I���B�
B'c���[OoQ[m[OQQQQ5oU[mUO	[U2Q,2P!S[mh9h)c�0�[OQ2!)sEx-binary string)r�rr�s&&r r��ATest_hook_compressed.test_gz_with_encoding_fake.<locals>.<lambda>ms��2�:�:�6I�+Jr,r�rErrzEx-binary string)r�rrnr�rqrpr�s&  r �test_gz_with_encoding_fake�/Test_hook_compressed.test_gz_with_encoding_fakejsU���	�	�
�J��	�	&��.�.�y�#��P�F�%�D�I�����f��(:�';�<��&�D�I�s�A!�!
A.zRequires bz2c�T�[OoUO[m[OQQ2oU[mUOUOO]2UOUOOQ-12P!S[mh9h)�test.bz2rE)r
rE)�bz2�BZ2Filer�rnr�rqr�r�r�s&  r �test_bz2_ext_fake�&Test_hook_compressed.test_bz2_ext_faketsy�����
��n�n���	(��.�.�z�3�?�F�'�C�K�������8�8�!�<�������7�7�:K�R�9P�Q��(�C�K�rc�,�UOQQ2P!)z	abcd.blahr���do_test_use_builtin_open_binaryr3s&r �
test_blah_ext�"Test_hook_compressed.test_blah_ext�s���,�,�[�$�?r,c�,�UOQQ2P!)zabcd.Gzr�rr3s&r �test_gz_ext_builtin�(Test_hook_compressed.test_gz_ext_builtin�s���,�,�Y��=r,c�,�UOQQ2P!)zabcd.Bz2r�rr3s&r �test_bz2_ext_builtin�)Test_hook_compressed.test_bz2_ext_builtin�s���,�,�Z��>r,c�,�UOQQ2P!)r�r�rr3s&r �test_binary_mode_encoding�.Test_hook_compressed.test_binary_mode_encoding�s���,�,�V�T�:r,c�,�UOQQ2P!r�r�r3s&r �test_text_mode_encoding�,Test_hook_compressed.test_text_mode_encoding�r�r,c�`�UOUO2o[OV2oUOU2UO	UOO
]2UO	UOOV1QPQP-12P!SOS2h9h)rxrr���replace_builtin_openr�rnr�rqr�r��rr>rrr�s&&&  r r�4Test_hook_compressed.do_test_use_builtin_open_binary�s����1�1�$�.�.�A�
�	5��.�.�x�>�F��%�%�m�4�������8�8�!�<�������7�7�#�*�Z��x��,N�O�	Q��
�%�%�m�4���B�B-c�`�UOUO2o[OV2oUOU2UO	UOO
]2UO	UOOV1QQQP-12P!SOS2h9h)rxr�localer�r!r#s&&&  r r��2Test_hook_compressed.do_test_use_builtin_open_text�s����1�1�$�.�.�A�
�	5��.�.�x�>�F��%�%�m�4�������8�8�!�<�������7�7�#�*�Z��8�T�,R�S�	U��
�%�%�m�4�r%c�>�[OoU[mU!r0)�builtinsr)�
new_open_funcrs& r r"�)Test_hook_compressed.replace_builtin_open�s�� �
�
�
�%��
��r,)r�)r$r%r&r'rrr�r��unittest�
skipUnlessr�rrrr
rrrrrrr��staticmethodr"r(r)r*s@r r�r�Rs�����.�4�8�����7�8�	Q�9�	Q�����7�8�=�9�=�����n�-�	R�.�	R�@�>�?�;�8�	Q�	U����r,r�c�4`�\sQsQsnQsQsQsQsUsP!)�Test_hook_encoded�c�v�[2o[2o[OVQ5o[2o[O
oU[m[2o[2oUVg2oU[mUO
UO]2UOvq�UOU	]*U2UOU	]*U2UOU
OQ2U2UOU
OQ2U2UOU
2P!S[mh9h)�r�rr�)r�rnrr�r*rrqr�r�r��poprt)rrr�r�r�rr>r�open_resultr�r�s&          r �test�Test_hook_encoded.test�s����8������'�'��@��&�(�	� �
�
�
�!��
�	*��x�H��8�D� ��0�K�)�H�M�����3�3�Q�7� �0�0����
�
�d�1�g�x�(��
�
�d�1�g�t�$��
�
�f�j�j��,�h�7��
�
�f�j�j��*�F�3����� ��*�H�M�s�D+�+
D8c�`�[[Q29^tt^2oUOQ2PPP2RO[[2U1QkoUQQ,2RO[29^tt^2UQQ,2PPP2UQQ,2UQQ	,2P!)%fhK�9h)%fhK99h)
r�s�abcc	��:�[[Q[QUQ5Q59^tt^2o[U2oPPP2RO	WU2P!)%fhK$9h)rErr4�rerr?�rrrrprq)r��expected_linesr�rMrs&&  �r �check�,Test_hook_encoded.test_errors.<locals>.check�sQ�����c�$0���$H�J�J�MO��R���J�
���U�N�3�J�J�s�A�A 	�A 	�ignore�abc�strictr�u�abc�backslashreplacez\x80abc)rrrrr�r�r��rrr>sf  r �test_errors�Test_hook_encoded.test_errors�s����
�&�$�
�
�1�
�G�G�J�� �����V�,�	4�	�h��� �
�
�
�1�
2�
2��(�U�G�$�3�
�i�+��'�
� �:�,�/� �
��3�
2�s#�B%�<B8�%B5	�.B5	�8C	�C	c�t`�[[Q29^tt^2oUOQ2PPP2RO[[2U1QkoUQ,QN2RO[29^tt^2UQ,QN2PPP2P!)%fhKn9h)%fhP!9h)r�s
A
B
C
D+IKw-c��:�[[U[Q2Q59^tt^2o[U2oPPP2RO	WU2P!)%fhK$9h)zutf-7r;r<)rr=r�rMrs&&  �r r>�+Test_hook_encoded.test_modes.<locals>.check�sJ�����d�$0��$9�;�;�>@��R���;�
���U�N�3�;�;�s�A�A	�A	rEr�)r�r�r��D€)r�zB
zC
rJ)rrrrr�r�r�rDsf  r �
test_modes�Test_hook_encoded.test_modes�s���
�&�$�
�
�1�
�G�G�(�)� �	
����V�,�	4�	�c�3�4�
�
�
�z�
*�
*��$�:�;�+�
*� �
��+�
*�
*�s#�B�=B&�B#	�B#	�&B7	�/B7	r#)	r$r%r&r'r7rErKr(r)r*s@r r1r1�s����!�00�"<�<r,r1c�(`�\sQsQsnQsQsUsP!)�MiscTestr�c�>�[OU[2P!r0)r�check__all__rnr3s&r �test_all�MiscTest.test_all�s�����T�9�-r,r#)r$r%r&r'rQr(r)r*s@r rNrN�s����.�.r,rN�__main__)2r�r
rxrmrnrJr*rr-r�ImportErrorr�rrrr�test.supportr�test.support.os_helperrrr	r�r
r7rrrr.�TestCaserVr�r�rCrkr�r�r�r�r�r�r�r�r�r�r�r1rNr$�mainr#r,r �<module>rYs���

�	�
�	����������!�-� �3�8�"���	�	�"
�"
�HQ�y�(�"3�"3�Q�f$�$�E�Y�� 1� 1�E�D
--�--�^0�X�%6�%6�0�*==�9�==�~,�9�,�&2�<�2�62�<�2�62�:�2�62� >�2�62�:�2�82�!?�2�62�;�2�6)�)�W�8�,�,�W�r:<��)�)�:<�z.�x� � �.��z���M�M�O���{��
�C������D��s.�F�F'�F$�F$�#F$�'F4�-F4�3F4

Youez - 2016 - github.com/yon3zu
LinuXploit