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:/Python312/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/test/__pycache__/test_threadedtempfile.cpython-312.opt-1.pyc
�

���g����dZddlZddlmZddlZddlZddlZddlmZejd��dZ
dZej�Z
Gd	�d
ej�ZGd�dej �Zed
k(rej&�yy)an
Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile)
in each of NUM_THREADS threads, recording the number of successes and
failures.  A failure is a bug in tempfile, and may be due to:

+ Trying to create more than one tempfile with the same name.
+ Trying to delete a tempfile that doesn't still exist.
+ Something we've never seen before.

By default, NUM_THREADS == 20 and FILES_PER_THREAD == 50.  This is enough to
create about 150 failures per run under Win98SE in 2.0, and runs pretty
quickly. Guido reports needing to boost FILES_PER_THREAD to 500 before
provoking a 2.0 failure under Linux.
�N)�threading_helper)�	print_excT)�module��2c��eZdZdZdZd�Zy)�TempFileGreedyrc�`�tj�|_tj	�tt�D]=}	tjd�}|j�|xjdz
c_
�?y#|xjdz
c_t|j��Y�pxYw)Nzw+b�)�file)
�io�StringIO�errors�
startEvent�wait�range�FILES_PER_THREAD�tempfile�
TemporaryFile�close�ok_count�error_countr)�self�i�fs   �/C:\Python312\\Lib\test\test_threadedtempfile.py�runzTempFileGreedy.run%s{���k�k�m��������'�(�A�
#��*�*�5�1�����	�
�
�
��"�
�)��
,�� � �A�%� ��t�{�{�+�s�%A>�>-B-N)�__name__�
__module__�__qualname__rrr��rr	r	!s���K��H�#r"r	c��eZdZd�Zy)�ThreadedTempFileTestc�<�tt�D�cgc]}t���}}tj|t
j�5	ddd�td�|D��}|D�cgc]G}|jr9t|j�t|jj��z��I}}dt|�|dj|�fz}|j|g|�|j|tt z�ycc}w#1swY��xYwcc}w)Nc3�4K�|]}|j���y�w)N)r)�.0�ts  r�	<genexpr>z1ThreadedTempFileTest.test_main.<locals>.<genexpr>8s����-�W�����W�s�zErrors: errors %d ok %d
%s�
)r�NUM_THREADSr	r�
start_threadsr�set�sumr�str�namer�getvalue�len�join�assertEqualr)rr�threads�okr(r�msgs       r�	test_mainzThreadedTempFileTest.test_main4s���-2�;�-?�@�-?��>�#�-?��@�
�
+�
+�G�Z�^�^�
D��E�
�-�W�-�
-��"�5�"�a�a�m�m��a�f�f�+��A�H�H�$5�$5�$7� 8�8�"�	�5�,�s�6�{�B��I�I�f��/��������S�)�����[�+;�;�<��A�
D�
D��5s�D�	D
�)AD�
DN)rrr r8r!r"rr$r$3s��=r"r$�__main__)�__doc__r�test.supportr�unittestr
�	threading�	tracebackr�requires_working_threadingr+r�Eventr�Threadr	�TestCaser$r�mainr!r"r�<module>rDs���
��)��	���+��+�+�4�8������Y�_�_�
�
�#�Y�%�%�#�$=�8�,�,�=��z���H�M�M�O�r"

Youez - 2016 - github.com/yon3zu
LinuXploit