Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/bisect_cmd.cpython-310.pyc
o

�9j��@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
dd�Zdd�Zdd�Z
d	d
�Zdd�Zdd
d�Zdd�Zdd�ZedkrPe�dSdS)a�
Command line tool to bisect failing CPython tests.

Find the test_os test method which alters the environment:

    ./python -m test.bisect_cmd --fail-env-changed test_os

Find a reference leak in "test_os", write the list of failing tests into the
"bisect" file:

    ./python -m test.bisect_cmd -o bisect -R 3:3 test_os

Load an existing list of tests from a file using -i option:

    ./python -m test --list-cases -m FileTests test_os > tests
    ./python -m test.bisect_cmd -i tests test_os
�NcCsNt|d��}|D]}t||d�q|��Wd�dS1s wYdS)N�w)�file)�open�print�flush)�filename�tests�fp�name�r�&/usr/lib/python3.10/test/bisect_cmd.py�write_testss

"�r
cCs*|sdStdt|�|f�t||�|S)NzWriting %s tests into %s)r�lenr
)rrrrr�write_output&s

rcCs
d�|�S)N� )�join)�argsrrr�format_shell_args.s
rcCs(tjg}|�t���|�t���|S�N)�sys�
executable�extend�
subprocess�_args_from_interpreter_flags�"_optim_args_from_interpreter_flags)�cmdrrr�
python_cmd2srcCslt�}|�gd��|�|j�tj|tjdd�}|j}|r/t|�}td||f�t	�
|�|j��}|S)N)�-m�testz--list-casesT)�stdout�universal_newlinesz1Failed to list tests: %s failed with exit code %s)
rr�	test_argsr�run�PIPE�
returncoderrr�exitr�
splitlines)rr�proc�exitcoderrrr�
list_cases9s ��

r)c	Cs�t��}z4t||�t�}|�ddd|g�|�|j�tdt|��t�	|�}|j
Wtj�
|�r8t�|�SStj�
|�rEt�|�ww)Nrrz--matchfilez+ %s)�tempfile�mktempr
rrr!rrrr"r$�os�path�exists�unlink)rr�
huntrleaks�tmprr'rrr�	run_testsJs

��r2cCsft��}|jdddd�|jdddd�|jdd	td
dd�|jd
dtddd�|��\}}||_|S)Nz-iz--inputzUTest names produced by --list-tests written into a file. If not set, run --list-tests)�helpz-oz--outputzResult of the bisectionz-nz--max-tests�z:Maximum number of tests to stop the bisection (default: 1))�type�defaultr3z-Nz
--max-iter�dz5Maximum number of bisection iterations (default: 100))�argparse�ArgumentParser�add_argument�int�parse_known_argsr!)�parserrr!rrr�
parse_argsZs ����r>cCs^t�}d|jvs
d|jvrtd�t�|jr4t|j��}dd�|D�}Wd�n1s.wYnt|�}tdt|��tdt|j��td|j|j	f�t
|j|�}t�t�
�}d	}zit|�|jkr�||j	kr�t|�}t|d
d	�}t�||�}td|t|�t|�f�t�t||�}td|t|�f�td
|�|r�td�|}t
|j|�}ntd�t�|d	7}t|�|jkr�||j	ksoWnty�t�td�t�Ynwtdt|��|D]}	td|	�q�t�|r�td|�t�t�
�|�}
t|�|jk�r!td|tj|
d�f�t�d	�dStd|tj|
d�f�dS)Nz-wz
--verbose2z;WARNING: -w/--verbose2 option should not be used to bisect!cSsg|]}|���qSr)�strip)�.0�linerrr�
<listcomp>vszmain.<locals>.<listcomp>zStart bisection with %s testszTest arguments: %szxBisection will stop when getting %s or less tests (-n/--max-tests option), or after %s iterations (-N/--max-iter option)r4�z![+] Iteration %s: run %s tests/%szran %s tests/%sr%z*Tests failed: continuing with this subtestz;Tests succeeded: skipping this subtest, trying a new subsetzBisection interrupted!zTests (%s):z* %szOutput written into %sz+Bisection completed in %s iterations and %s)�secondsz+Bisection failed after %s iterations and %s)r>r!r�inputrr)rr�	max_tests�max_iterr�output�time�	monotonic�max�random�sampler2�KeyboardInterrupt�math�ceil�datetime�	timedeltarr%)rr	rrH�
start_time�	iteration�ntest�subtestsr(r�dtrrr�mainnsx��
��

��
��
�rX�__main__r)�__doc__r8rQ�os.pathr,rOrLrrr*rIr
rrrr)r2r>rX�__name__rrrr�<module>s*
D
�

Youez - 2016 - github.com/yon3zu
LinuXploit