403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.66
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_file_eintr.cpython-315.pyc
R
>lqj,c�f�]PHs]PHs]PHs]PHs]PHs]PHs]PHs]QHGs\O%f\OQ2g]PH,s]PH0s\O\OQ6HQ2QQ22sQQ\\O 2sQ	Q
\\O 2sQQ\2sQ
Q\\O 2sQQ\\O 2sQQ\2sQQ\\O 2sQQ\\O 2s\Q6Xc\O42P!P!)�)�supportztest module requires subprocess�posixztests requires a posix system.c�Z`�\sQs]snQsQsQsQQksQsQs	Qs
QsQ	sQ
s
UsP!)�TestFileIOSignalInterruptc��PUmP!�N��_process��selfs&�)C:\Python315\\Lib\test\test_file_eintr.py�setUp�TestFileIOSignalInterrupt.setUps	����
�c���UO%c<UOO2eUOO2P!P!P![cP!h9hr)r	�poll�kill�OSErrorr
s&r�tearDown�"TestFileIOSignalInterrupt.tearDown sM���=�=�=�T�]�]�/�/�1�9�
��
�
�"�"�$�:�=���
��
�s�A�	A �A �A c�*�QUO*!)zReturns the infile = ... line of code for the reader process.

subclasseses should override this to test different IO objects.
z=import %s as io ;infile = io.FileIO(sys.stdin.fileno(), "rb")��modnamer
s&r�_generate_infile_setup_code�5TestFileIOSignalInterrupt._generate_infile_setup_code's��
?�����	rc	��UOO2e2[OQ2UOO	2U%c-UOO
2vqVV%*
oV6*
oUOQU8QUO28QUO28Q02P![
cK}h9h)a�A common way to cleanup and fail with useful debug output.

Kills the process if it is still running, collects remaining output
and fails the test with an error message including the output.

Args:
    why: Text to go after "Error from IO process" in the message.
    stdout, stderr: standard output and error from the process so
        far to include in the error message.
    communicate: bool, when True we call communicate() on the process
        after killing it to gather additional output.
g�������?zError from IO process z
:
STDOUT:
zSTDERR:
�
)	r	r�time�sleep�	terminater�communicate�fail�decode)r�why�stdout�stderrr �
stdout_end�
stderr_ends&&&&&  r�fail_with_process_info�0TestFileIOSignalInterrupt.fail_with_process_info0s����=�=����'��J�J�s�O�
��
�
�'�'�)��%)�]�]�%>�%>�%@�"�J�� �F�� �F��	�	���
�
������:�	;��
�
��
�s�B?�?	C
�	C
�C
c���UO2o[U2Q6fPQ2g[O[O
QQQU*Q*Q*U*Q*Q*,[O[O[OQ	5UmUOOO[Q
22oUQ
6wcUOQUQ5UOOOU2]o,oU%f�[OUOO,QQQ
2vooUOO[O 2U]*
oU]�6�fJuUOO#2UO%Q2J�UOOO'2oUQ6wcUOQUQ5UOO)QQ5vq�UOO*%c2UOQUOO**V�P
Q5P!P!)a&Generic buffered read method test harness to validate EINTR behavior.

Also validates that Python signal handlers are run during the read.

Args:
    data_to_write: String to write to the child process for reading
        before sending it a signal, confirming the signal was handled,
        writing a final newline and closing the infile pipe.
    read_and_verify_code: Single "line" of code to read from a file
        object named 'infile' and validate the result.  This will be
        executed as part of a python subprocess fed data_to_write.
�z#data_to_write must fit in pipe buf.z-uz-czXimport signal, sys ;signal.signal(signal.SIGINT, lambda s, f: sys.stderr.write("$\n")) ;z ;z"sys.stderr.write("Worm Sign!\n") ;zinfile.close())�stdinr$r%sWorm Sign!
zwhile awaiting a sign)r%g�������?z,reader process failed to handle our signals.s$
zwhile awaiting signal�
)�inputzexited rc=%d)r �)r�len�
subprocess�Popen�sys�
executable�PIPEr	r%�readr(r,�write�select�send_signal�signal�SIGINTrr!�readliner �
returncode)r�
data_to_write�read_and_verify_code�infile_setup_code�	worm_sign�signals_sent�rlist�_�signal_liner$r%s&&&        r�
_test_reading�'TestFileIOSignalInterrupt._test_readingKs��!�<�<�>���=�!�C�'�N�)N�N�'�#�(�(�����t�J�%�%�(,�,�7�	7�
(�(�
+/�/�"�
"��!�o�o�j�o�o�!���(��
��M�M�(�(�-�-�c�/�.B�C�	���'��'�'�(?�/8�
(�
:��
�
���!�!�-�0������ �-�-����)=�)=�(>��B��M�K�E�1�a��M�M�%�%�f�m�m�4��A��L��c�!��
�
�"�"�$��	�	�H�I��m�m�*�*�3�3�5���&� ��'�'�(?�/:�
(�
<����2�2��2�?����=�=�#�#�#��'�'�"�T�]�]�%=�%=�=���
(�
7�$rz�got = infile.{read_method_name}() ;expected = {expected!r} ;assert got == expected, ("{read_method_name} returned wrong data.\n""got data %r\nexpected %r" % (got, expected))c�d�UOQUOOQQQ5Q5P!)�1readline() must handle signals and not lose data.�
hello, world!r<shello, world!
��read_method_name�expected�r>r?�rF�_READING_CODE_TEMPLATE�formatr
s&r�
test_readline�'TestFileIOSignalInterrupt.test_readline�s8�����.�%)�%@�%@�%G�%G�)3�!3�&H�&5�	�	6rc�h�UOQUOOQQQ,Q5Q5P!)�2readlines() must handle signals and not lose data.�hello
world!�	readlinesshello
sworld!
rKrNrOr
s&r�test_readlines�(TestFileIOSignalInterrupt.test_readlines�s=�����.�%)�%@�%@�%G�%G�)4�",�k�!:�&H�&<�	�	=rc��UOQUOOQQQ5Q5UOQUOOQQQ5Q5P!)z0readall() must handle signals and not lose data.rV�readall�
hello
world!
rKrNr6rOr
s&r�test_readall�&TestFileIOSignalInterrupt.test_readall�sp�����.�%)�%@�%@�%G�%G�)2�!3�&H�&5�	�	6�	
���.�%)�%@�%@�%G�%G�)/�!3�&H�&5�	�	6rr)rrT)�__name__�
__module__�__qualname__�__firstlineno__r
rrr(rFrPrRrXr]�__static_attributes__�__classdictcell__��
__classdict__s@rrrs?�������;�6D7�R
E��6�=�6�6rrc��\sQs]�sQsQsP!)�CTestFileIOSignalInterrupt�_ior/�r_r`rarbrrcr/rrrhrh�����Grrhc��\sQs]�sQsQsP!)�PyTestFileIOSignalInterrupt�_pyior/rjr/rrrmrm�����Grrmc�.`�\sQs]�snQsQsQsUsP!)�TestBufferedIOSignalInterruptc�*�QUO*!)z?Returns the infile = ... line of code to make a BufferedReader.ziimport %s as io ;infile = io.open(sys.stdin.fileno(), "rb") ;assert isinstance(infile, io.BufferedReader)rr
s&rr�9TestBufferedIOSignalInterrupt._generate_infile_setup_code�s��?�����	rc�d�UOQUOOQQQ5Q5P!)z<BufferedReader.read() must handle signals and not lose data.rVr6r\rKrNrOr
s&rr]�*TestBufferedIOSignalInterrupt.test_readall�s8�����.�%)�%@�%@�%G�%G�)/�!3�&H�&5�	�	6rr/)r_r`rarbrr]rcrdres@rrqrq�s�����6�6rrqc��\sQs]�sQsQsP!)�CTestBufferedIOSignalInterruptrir/rjr/rrrwrw�rkrrwc��\sQs]�sQsQsP!)�PyTestBufferedIOSignalInterruptrnr/rjr/rrryry�rorryc�:`�\sQs]�snQsQsQsQsQsUs	P!)�TestTextIOSignalInterruptc�*�QUO*!)z>Returns the infile = ... line of code to make a TextIOWrapper.z�import %s as io ;infile = io.open(sys.stdin.fileno(), encoding="utf-8", newline=None) ;assert isinstance(infile, io.TextIOWrapper)rr
s&rr�5TestTextIOSignalInterrupt._generate_infile_setup_code�s��>�����	rc�d�UOQUOOQQQ5Q5P!)rIrJr<zhello, world!
rKrNrOr
s&rrR�'TestTextIOSignalInterrupt.test_readline�s8�����.�%)�%@�%@�%G�%G�)3�!2�&H�&4�	�	5rc�h�UOQUOOQQQ,Q5Q5P!)rUs
hello
world!rWzhello
zworld!
rKrNrOr
s&rrX�(TestTextIOSignalInterrupt.test_readlines�s=�����0�%)�%@�%@�%G�%G�)4�"+�Z�!8�&H�&:�	�	;rc�d�UOQUOOQQQ5Q5P!)z-read() must handle signals and not lose data.rVr6z
hello
world!
rKrNrOr
s&rr]�&TestTextIOSignalInterrupt.test_readall�s8�����.�%)�%@�%@�%G�%G�)/�!2�&H�&4�	�	5rr/)
r_r`rarbrrRrXr]rcrdres@rr{r{�s�����5�;�5�5rr{c��\sQs]�sQsQsP!)�CTestTextIOSignalInterruptrir/rjr/rrr�r��rkrr�c��\sQs]�sQsQsP!)�PyTestTextIOSignalInterruptrnr/rjr/rrr�r��rorr��__main__)�osr8r:r1r3r�unittest�testr�has_subprocess_support�SkipTestrirn�
skipUnless�namer�TestCaserhrmrqrwryr{r�r�r_�mainr/rr�<module>r�s)��
�
�
��
�����%�%�%�
�
�
�=�
>�>���	���R�W�W��'�)I�J�[6�[6�K�[6�|�!:�H�<M�<M���";�X�=N�=N��
6�$=�
6��%B�H�DU�DU���&C�X�EV�EV��5� 9�5�@�!:�H�<M�<M���";�X�=N�=N���z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit