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

�9j�'�@sBdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddlmZddl
mZmZddlZddlZdZedZGd	d
�d
�ZGdd�de�Zd
d�ZGdd�deej�Ze�eed�d�Gdd�deej��Zdd�ZGdd�deej�ZGdd�deej�Zdd�Z e!dkr�e�"�dSdS)z9Test largefile support on system where this makes sense.
�N)�requires�
bigmemtest)�
SHORT_TIMEOUT)�
socket_helper)�TESTFN�unlinkly*�2c@s eZdZdd�Zedd��ZdS)�
LargeFileTestcCs�tj�t�r	d}nd}|�t|��N}t�|���tj}|t	dkr+	Wd�dS|dkr4|�
d�|�d�|�t	�|�
d�|��|�
t�|���tjt	d�Wd�dS1sbwYdS)N�r+bzw+b�r�z�a)�os�path�existsr�open�fstat�fileno�stat�ST_SIZE�size�write�seek�flush�assertEqual)�self�mode�f�current_size�r�*/usr/lib/python3.10/test/test_largefile.py�setUps �



""�zLargeFileTest.setUpcCsV|�td��Wd�n1swYt�t�tjdks%|�d��tt�dS)N�wbrz0File was not truncated by opening with mode "wb")rrrrr�failureExceptionr�TESTFN2)�clsrrr �
tearDownClass-s�
zLargeFileTest.tearDownClassN)�__name__�
__module__�__qualname__r!�classmethodr&rrrr r	sr	c@sNeZdZdZeeddd�dd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�TestFileMethodszWTest that each file function works as expected for large
    (i.e. > 2 GiB) files.
    �F)r�memuse�dry_runcCs^|�td��}|�t|���td�|�|��td�Wd�dS1s(wYdS)N�rbr)rrr�len�readr�tell)r�_sizerrrr �test_large_read>s"�zTestFileMethods.test_large_readcCs |�t�t�tjtd�dS)Nr)rrrrrr�rrrr �test_osstatEs zTestFileMethods.test_osstatcCs�|�td���}|�|��d�|�|�d�d�|�|��d�|�d�|�|��d�|�dd�|�|��d�|�d�|�|��d�|�dd�|�|��d�|�dd�|�|��d�|�dd�|�|��d�|�dd�|�|��tdd�|�dd�|�|��tdd	�|�tdd�|�|��d�|�t�|�|��t�|�|�d�d
�|�tdd�|�|�d�d�|�|��d�Wd�dS1s�wYdS)Nr/rrr�*�Tr,����
r
)rrrr2r1rr�rrrrr �test_seek_readHs:


"�zTestFileMethods.test_seek_readcCs*|�td���}|�t�|��dd�d�|�t�|��dd�d�|�t�|��dd�d�|�t�|��dd�d�|�t�|��dd�tdd�|�t�|��dd�tdd�|�t�|��tdd�d�|�t�|��td�t�|�|�d�d	�Wd�dS1s�wYdS)
Nr/rr7rr8r,r9r:r
)rrrr�lseekrrr1r;rrr �
test_lseekgs"" "�zTestFileMethods.test_lseekcCs6|�td���}t|d�st�d��|�dd�|�|��td�td}|�|�|�	�|�|��|�|�dd�|�|��|�|d8}|�d�|�	|�|�|��d�|�dd�|�|��|�|�d�|�	d�|�|��d�|�d�|�t
|���d�Wd�dS1s�wYdS)	Nr
�truncatez.open().truncate() not available on this systemrr,rr:r7)rr�hasattr�unittest�SkipTestrrr2rr?r0r1)rr�newsizerrr �
test_truncatets.







"�zTestFileMethods.test_truncatec	CsRdD]$}|�td��}|�|�|�|���Wd�n1s!wYqdS)N)i���l�r/)rrr�
assertTrue�seekable)r�posrrrr �
test_seekable�s
���zTestFileMethods.test_seekableN)r'r(r)�__doc__rrr4r6r<r>rDrIrrrr r+7s

r+cs��fdd�}|S)Ncs���fdd�}|S)NcsHt�tj����j�krt�dd�}t�d|�d����|i|��S)Niz	required z MiB of free disk space)	�shutil�
disk_usagerr�realpath�free�intrArB)�args�kwargs�hsize)�funr�requiredrr �wrapper�s
�z6skip_no_disk_space.<locals>.decorator.<locals>.wrapperr)rSrU�rrT)rSr �	decorator�sz%skip_no_disk_space.<locals>.decoratorr)rrTrWrrVr �skip_no_disk_space�srXc@s,eZdZeej�Zeeed�dd��Z	dS)�TestCopyfile�@cCs�tj�t�}t�tt�|�tj�t�|�ttd��!}|�|�	d�d�|�
|d�|�|�	�d�Wd�dS1s?wYdS)Nr/��z�a)rr�getsizerrK�copyfiler$rrr1r)rrrrrr �test_it�s"�zTestCopyfile.test_itN)
r'r(r)�staticmethod�iorrXrrr`rrrr rY�s
rY�sendfilezsendfile not supportedcsTeZdZeej�ZeZ�fdd�Z�fdd�Z	dd�Z
eee
d�dd	��Z�ZS)
�TestSocketSendfilecst���d|_dS�N)�superr!�threadr5��	__class__rr r!�s

zTestSocketSendfile.setUpcs0t���|jdur|j�|j�d|_dSdSre)rf�tearDownrg�join�timeoutr5rhrr rj�s



�zTestSocketSendfile.tearDowncsJ��fdd�}t���|��j�tj||fd��_�j�����dS)Nc
s�|�f|��\}}|��j�|�?ttd��*}���j�	|�d�}|s;	Wd�Wd�Wd�dS|�|�q1sDwYWd�n1sSwYWd�dSWd�dS1skwYdS)Nr"Ti)�accept�
settimeoutrlrr$�wait�recvr)�sock�conn�_r�chunk��eventrrr �run�s"
��
	�0��"�z*TestSocketSendfile.tcp_server.<locals>.run)�targetrP)�	threading�Eventrnrl�Threadrg�start�set)rrqrwrrur �
tcp_server�s
zTestSocketSendfile.tcp_serverrZc
Cs*t��}t�d|f��>}|�|�t�d|f��"}ttd��
}|�|�Wd�n1s.wYWd�n1s=wYWd�n1sLwY|�	�t
j�t�}|�
t
j�t�|�ttd��!}|�
|�d�d�|�|d�|�
|��d�Wd�dS1s�wYdS)N�z	127.0.0.1r/r[r\r])r�find_unused_port�socket�
create_serverr~�create_connectionrrrcrjrrr^rr$r1r)r�portrq�clientrrrrr r`�s&
�����"�zTestSocketSendfile.test_it)r'r(r)rarbrrrlr!rjr~rXrrr`�
__classcell__rrrhr rd�s
rdc	Cs�zddl}|�|j|j�WnttfyYnwtjdd�dks(tjdkr3tddtt	��dSt
tddd�}z*z|�d	�|�
d
�|��WnttfyYt�d��wW|��tt�dS|��tt�w)Nr��win�darwin�	largefilez-test requires %s bytes and a long time to runr")�	bufferingrE�xz*filesystem does not have largefile support)�signal�SIGXFSZ�SIG_IGN�ImportError�AttributeError�sys�platformr�strrrrrrr�OSError�
OverflowErrorrArB�closer)r�rrrr �setUpModule�s.�
�


���
r�c@�eZdZeej�ZdS)�CLargeFileTestN)r'r(r)rarbrrrrr r��r�c@r�)�PyLargeFileTestN)r'r(r)ra�pyiorrrrr r�r�r�cCstt�tt�dSre)rrr$rrrr �tearDownModulesr��__main__)#rJrrr�rAr�rKry�test.supportrrrr�test.support.os_helperrrrb�_pyior�rr$r	r+rX�TestCaserY�skipIfr@rdr�r�r�r�r'�mainrrrr �<module>s: e5$�

Youez - 2016 - github.com/yon3zu
LinuXploit