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__/test_zipimport_support.cpython-310.pyc
o

�9j�)�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlmZddl
mZmZmZmZmZejjZddlmZmZmZmZdd�ZGdd�dej�Zd	d
�Zedkrke��dSdS)�N)�	os_helper)�spawn_python�kill_python�assert_python_ok�make_script�make_zip_script)�test_doctest�sample_doctest�sample_doctest_no_doctests�sample_doctest_no_docstringscCs�tjtdd�}tjtd�}z
d|j|jf}Wnty#|j}Ynw|�|||�D]}|�	|�q+|j
|j}}|rFtj
�d||f��trQtd|j|f�||fS)NF)�verbose�recurse)rz%s.%sz%d of %d doctests failedz,doctest (%s) ... %d tests with zero failures)�doctest�
DocTestFinderr�
DocTestRunner�
__module__�__qualname__�AttributeError�__name__�find�run�failures�tries�test�support�
TestFailed�print)�obj�module�finder�runner�name�example�f�t�r%�2/usr/lib/python3.10/test/test_zipimport_support.py�_run_object_doctest$s
�r'c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ZipSupportTestscCsPt��tj��tjdd�|_tjdd�|_tjdd�|_tj	��dS�N)
�	linecache�
clearcache�	zipimport�_zip_directory_cache�clear�sys�path�	meta_path�
path_hooks�path_importer_cache��selfr%r%r&�setUpAs
zZipSupportTests.setUpcCs>|jtjdd�<|jtjdd�<|jtjdd�<tj��dSr))r0r/r1r2r3r.r4r%r%r&�tearDownIszZipSupportTests.tearDownc	Cs�d}t���I}t|d|�}tj�dtj�|��}t|d||�\}}t�|�t	j�
d|�ddl}z|�t
�|j�|�Wt	jd=nt	jd=wWd�dS1sRwYdS)Nzdef foo(): pass
�__init__�zip_pkg�test_zipr)r�temp_dirr�osr0�join�basenamer�remover/�insertr9�assertEqual�inspect�	getsource�foo�modules)r5�test_src�d�	init_name�name_in_zip�zip_name�run_namer9r%r%r&� test_inspect_getsource_issue4223Os 

��
"�z0ZipSupportTests.test_inspect_getsource_issue4223cCsHt�t�}|�dd�}|�dd�}|�dd�}i}tttfD]}t�|�}|�dd�}|j�d�d}|�d	d
�}|||<qt	�
���}t|d|�}t|d|�\}}	t
�|d��}
|��D]\}}|
�|d
|�q\Wd�n1sswYtr�t
�|d��}td|�|��Wd�n1s�wYt�|�tj�d|�ddl}za|j|jj|jjj|jj|jj|jj|jj|jj |jj!|j"|j"j|j"j |j"j!|j#|j$|j%|j&j'|j&j(|j&j)|j&j*|j&j+|j,|j-|j.|j/|j0|j1g}
|j2|j3|j4g}|
D]}t5||�q�Wtj6d=ntj6d=wWd�dS1�swYdS)Nzfrom test import test_doctestz*import test_zipped_doctest as test_doctestztest.test_doctest�test_zipped_doctestztest.sample_doctest�sample_zipped_doctest�.����sample_�sample_zipped_r:�az.py�rzContents of %r:r)7rBrCr�replacer	r
rr�splitrr;rr�zipfile�ZipFile�items�writestrrr�printdirr<r?r/r0r@rM�SampleClass�NestedClassr8�
a_classmethod�
a_property�a_staticmethod�double�get�SampleNewStyleClass�sample_func�test_DocTest�test_DocTestParser�test_DocTestRunner�basics�
exceptions�option_directives�optionflags�verbose_flag�test_Example�
test_debug�test_testsource�test_trailing_space_in_test�test_DocTestSuite�test_DocTestFinder�test_DocFileSuite�
test_testfile�test_unittest_reportflagsr'rE)r5rF�sample_sources�mod�src�mod_namerG�script_namerJrK�z�zip_filerM�known_good_tests�fail_due_to_missing_data_filesrr%r%r&�test_doctest_issue4197_s�
����


����
�
	� ��$�z&ZipSupportTests.test_doctest_issue4197cCs�t�d�}d}t���f}t|d|�}t|�\}}}||df}tr0td|�td�tt|��|�	|�
d�|�t|d|d	�\}	}
t|	�\}}}||
df}tr`td|�td�tt|��|�	|�
d�|�Wd�dS1stwYdS)
Nz�                    class Test:
                        ">>> 'line 2'"
                        pass

                    import doctest
                    doctest.testmod()
                    zFile "%s", line 2, in %s�scriptz
__main__.Testz
Expected linezGot stdout:�utf-8r:�__main__.py)�textwrap�dedentrr;rrrr�ascii�assertIn�encoder)r5rF�patternrGrz�rc�out�err�expectedrJrKr%r%r&�test_doctest_main_issue4197�s,


�
"�z+ZipSupportTests.test_doctest_main_issue4197cCs�t�d�}t���N}t|d|�}t|�}|j�d�t|�}|�	t
j�|�
d��|�t|d|d�\}}t|�}|j�d�t|�}|�	t
j�|�
d��|�Wd�dS1sZwYdS)Nz�                    def f():
                        pass

                    import pdb
                    pdb.Pdb(nosigint=True).runcall(f)
                    r�sl
r�r:r�)r�r�rr;rr�stdin�writerr�r<r0�normcaser�r)r5rFrGrz�p�datarJrKr%r%r&�test_pdb_issue4201�s

�"�z"ZipSupportTests.test_pdb_issue4201N)	rrrr6r7rLrr�r�r%r%r%r&r(8s	[r(cCstj��dSr))rr�
reap_childrenr%r%r%r&�tearDownModule�sr��__main__)�test.supportrr<�os.pathr/r�rWr,rrBr*�unittestr�test.support.script_helperrrrrrrrrr	r
rr'�TestCaser(r�r�mainr%r%r%r&�<module>s,8�

Youez - 2016 - github.com/yon3zu
LinuXploit