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_imghdr.cpython-310.pyc
o

�9j��@s�ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
dZGdd�dej�Z
Gdd�dej�Zed	krDe��dSdS)
�N)�findfile)�TESTFN�unlink)
)�
python.png�png)z
python.gif�gif)z
python.bmp�bmp)z
python.ppm�ppm)z
python.pgm�pgm)z
python.pbm�pbm)z
python.jpg�jpeg)z
python.ras�rast)z
python.sgi�rgb)zpython.tiff�tiff)z
python.xbm�xbm)zpython.webp�webp)z
python.exr�exrc@seZdZdd�Zdd�ZdS)�UnseekableIOcC�tj��N��io�UnsupportedOperation��self�r�'/usr/lib/python3.10/test/test_imghdr.py�tell�zUnseekableIO.tellcOrrr)r�args�kwargsrrr�seekrzUnseekableIO.seekN)�__name__�
__module__�__qualname__rr!rrrrrsrc@sxeZdZedd��Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�
TestImghdrcCsJtddd�|_t|jd��}|��|_Wd�dS1swYdS)Nr�
imghdrdata��subdir�rb)r�testfile�open�read�testdata)�cls�streamrrr�
setUpClass#s"�zTestImghdr.setUpClasscCstt�dSr)rrrrrr�tearDown)szTestImghdr.tearDownc	Cs�tD]`\}}t|dd�}|�t�|�|�t|d��}|�t�|�|�Wd�n1s.wYt|d��}|��}Wd�n1sGwY|�t�d|�|�|�t�dt|��|�qdS)Nr&r'r))�
TEST_FILESr�assertEqual�imghdr�whatr+r,�	bytearray)r�filename�expectedr/�datarrr�	test_data,s�
��zTestImghdr.test_datac	CsbtD],\}}|j|d��t|dd�}|�t�t�|��|�Wd�n1s)wYqdS)N)r7r&r')r2�subTestrr3r4r5�pathlib�Path)rr7r8rrr�test_pathlike_filename7s���z!TestImghdr.test_pathlike_filenamecCs:dd�}tj�|�|�tjj�|�t�dd�d�dS)NcSs|�d�rdSdS)N�eggs�ham)�
startswith)�h�filerrr�
test_jumbo>s
�z1TestImghdr.test_register_test.<locals>.test_jumbor?r@)r4�tests�append�
addCleanup�popr3r5)rrDrrr�test_register_test=szTestImghdr.test_register_testcCs�ttd��}|�d�|��}|�|j�Wd�n1swYttd��}|�|�|�t�|�d�|�|��|�Wd�dS1sKwYdS)N�wbs
ababagalamagar)r)	r+r�writerr-r!r3r4r5)rr/�posrrr�
test_file_posEs
�
"�zTestImghdr.test_file_posc	CsT|�t��t��Wd�n1swY|�t��
t�d�Wd�n1s.wY|�t��t�|jd�Wd�n1sJwY|�t��t�t�|j��Wd�n1shwYt|jd��-}|�t��t�|�	��Wd�n1s�wYWd�dSWd�dS1s�wYdS)N�r))
�assertRaises�	TypeErrorr4r5�AttributeErrorr*�os�fsencoder+�fileno)r�frrr�
test_bad_argsOs&
������"�zTestImghdr.test_bad_argscCs dD]}|�t�d|��qdS)N)s�PN
s�sY�scutecats	000000JFIsGIF80)�assertIsNoner4r5)r�headerrrr�test_invalid_headers\s�zTestImghdr.test_invalid_headersc
Cs�t���pt�dt�tD]^\}}t|dd�}t|d��}|���d�}Wd�n1s.wY|�	t
��t�t
�|��Wd�n1sKwY|�	t
��t�d|�Wd�n1sfwYq
Wd�dS1swwYdS)N�ignorer&r'r)�latin1)�warnings�catch_warnings�simplefilter�BytesWarningr2rr+r,�decoderOrPr4r5r�StringIO)rr7�_r/r9rrr�test_string_dataes 
�����"�zTestImghdr.test_string_datacCs:|�t��t�d�Wd�dS1swYdS)N�missing)rO�FileNotFoundErrorr4r5rrrr�test_missing_fileqs"�zTestImghdr.test_missing_filecCs�t|jd�}|��|�t��
}t�|�Wd�n1swYt�|j	�}|��|�t��}t�|�Wd�dS1sDwYdS)Nr))
r+r*�closerO�
ValueErrorr4r5r�BytesIOr-�rr/�cmrrr�test_closed_fileus�"�zTestImghdr.test_closed_filec	Cs�ttd��}|�|j�Wd�n1swYttd��,}|�tj��
t�	|�Wd�n1s7wYWd�dSWd�dS1sOwYdS)NrJr))
r+rrKr-rrOrrr4r5)rr/rrr�test_unseekables���"�zTestImghdr.test_unseekablec	Cs�ttd��6}|�|j�|�d�|�t��
}t�|�Wd�n1s&wYWd�dSWd�dS1s>wYdS)NrJr)	r+rrKr-r!rO�OSErrorr4r5rjrrr�test_output_stream�s
��"�zTestImghdr.test_output_streamN)r"r#r$�classmethodr0r1r:r>rIrMrVrYrcrfrlrmrorrrrr%"s


	
r%�__main__)r4rrRr<�unittestr\�test.supportr�test.support.os_helperrrr2�FileIOr�TestCaser%r"�mainrrrr�<module>sk�

Youez - 2016 - github.com/yon3zu
LinuXploit