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

�9j�Y�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddlm
Z
ddlmZddl
mZdd	d
�ZGdd�d�ZGd
d�deej�ZGdd�de�ZGdd�dej�Zedkree��dSdS)z3
Tests common to genericpath, ntpath and posixpath
�N)�support)�	os_helper)�warnings_helper)�assert_python_ok)�FakePath�foocCs<t|dd��}|�|�Wd�dS1swYdS)N�xbr)�open�write)�filename�data�fp�r�,/usr/lib/python3.10/test/test_genericpath.py�create_files"�rc@s�eZdZgd�ZgZdd�Zdd�Zdd�Zdd	�Zd
d�Z	e
�ee
d�d
�dd��Zdd�Zdd�Zdd�Zdd�Zejdd��Zdd�Zdd�Zdd�Zejd d!��Zd"d#�Zd$d%�Zd&S)'�GenericTest)�commonprefix�getsize�getatime�getctime�getmtime�exists�isdir�isfilec	CsV|j|jD]"}|�t��t|j|��|�d�|jj|���1s#wYqdS)Nz!{}.{}() did not raise a TypeError)	�common_attributes�
attributes�assertRaises�	TypeError�getattr�
pathmodule�fail�format�__name__)�self�attrrrr�test_no_arguments���zGenericTest.test_no_argumentc	Cs�|jj}|�|g�d�|�|ddg�d�|�|ddg�d�|�|ddg�d�|�|ddg�d	�|�|d
dg�d�|�|d
d
g�d
�|�|d
dg�d�|�|ddg�d�|�|ddg�d�|�|ddg�d�|�|ddg�d�|�|ddg�d�gd�}|D]7}|D]2}|||g�}|�|�|��|�|�|��||kr�t|�}|�|||d�|||d��q�q�dS)N�z/home/swenson/spamz/home/swen/spamz
/home/swenz/home/swen/eggsz/home/swen/zhome:swenson:spamzhome:swen:spamz	home:swenz:home:swen:spamz:home:swen:eggsz:home:swen:s/home/swenson/spams/home/swen/spams
/home/swens/home/swen/eggss/home/swen/shome:swenson:spamshome:swen:spams	home:swens:home:swen:spams:home:swen:eggss:home:swen:)r&�abc�Xbcd�Xb�XY�abcd�aXc�abd�ab�aX�abcX�)rr�assertEqual�
assertTrue�
startswith�len�assertNotEqual)r#r�testlist�s1�s2�p�nrrr�test_commonprefix"s��
�
�
�
�
�
�
�
�
�
�
�
�$���zGenericTest.test_commonprefixcCs^tj}|�tj|�t|d�|�|j�|�d�t�	|�t|d�|�|j�|�d�dS)NsHello�sHello World!�)
r�TESTFN�
addCleanup�unlinkrr2rr�os�remove)r#rrrr�test_getsizees


zGenericTest.test_getsizecCs�tj}|�tj|�t|d�t|dd��
}|�d�Wd�n1s%wYt|dd��}|��}Wd�n1s?wY|�|d�|�	|j
�|�|j
�|��dS)Nrr.r�bar�rbsfoobar)
rr?r@rArr	r
�readr2�assertLessEqualrrr)r#r�frrrr�
test_filetimeps
�
�

�zGenericTest.test_filetimecCsptj}t�|�}|�tj|�|�|j�|�d�|�|j�|�d�t	|�|�|j�|�d�|�|j�|�d�|�|j�|d�d�|�|j�|d�d�|�|j�|d�d�|�|j�|d�d�|jt
ur�|�|j�|�d�|�|j�|�d�|�|j�|d�d�|�|j�|d�d�|�|j�|d�d�|�|j�|d�d�dSdS)NFT������)rr?rB�fsencoder@rA�assertIsrrr�genericpath�lexists�r#r�	bfilenamerrr�test_exists�s(

�zGenericTest.test_exists�pipezrequires os.pipe()c	Csdt��\}}z|�|j�|��Wt�|�t�|�nt�|�t�|�w|�|j�|��dS�N)rBrVr3rr�close�assertFalse)r#�r�wrrr�test_exists_fd�s

�zGenericTest.test_exists_fdc	Cs4tj}t�|�}|�|j�|�d�|�|j�|�d�|�|j�|d�d�|�|j�|d�d�|�|j�|d�d�|�|j�|d�d�zt|�|�|j�|�d�|�|j�|�d�Wt�|�nt�|�wz!t�	|�|�|j�|�d�|�|j�|�d�Wt�
|�dSt�
|�w�NFrKrLrMrNT)rr?rBrOrPrrrrA�mkdir�rmdirrSrrr�
test_isdir��$

zGenericTest.test_isdirc	Cs4tj}t�|�}|�|j�|�d�|�|j�|�d�|�|j�|d�d�|�|j�|d�d�|�|j�|d�d�|�|j�|d�d�zt|�|�|j�|�d�|�|j�|�d�Wt�|�nt�|�wz!t�	|�|�|j�|�d�|�|j�|�d�Wt�
|�dSt�
|�wr])rr?rBrOrPrrrrAr^r_rSrrr�test_isfile�razGenericTest.test_isfilecCsxtj}tjd}|�tj|�|�tj|�t|�|�|j�||��t|�|�|j�||��|�	t
|jj�dS�N�2)rr?r@rArr3r�samefilerYrr)r#�file1�file2rrr�
test_samefile�s
zGenericTest.test_samefilecCs|tj}tjd}|�tj|�|�tj|�t|�|||�|�|j�||��t�	|�t|�|�
|j�||��dSrc)rr?r@rArr3rrerBrCrY�r#�func�test_fn1�test_fn2rrr�_test_samefile_on_link_func�s


z'GenericTest._test_samefile_on_link_funccC�|�tj�dSrW)rmrB�symlink�r#rrr�test_samefile_on_symlink��z$GenericTest.test_samefile_on_symlinkc
C�Hz	|�tj�WdSty#}z|�d|�WYd}~dSd}~ww�Nz
os.link(): %s)rmrB�link�PermissionError�skipTest�r#�errr�test_samefile_on_link����z!GenericTest.test_samefile_on_linkcCs�tj}tjd}|�tj|�|�tj|�t|�t�|�}|�|j�	|t�|���t|�t�|�}|�
|j�	||��|�t|jj	�dSrc)
rr?r@rArrB�statr3r�samestatrYrr)r#rkrl�stat1�stat2rrr�
test_samestats


zGenericTest.test_samestatcCs�tjd}tjd}|�tj|�|�tj|�t|�|||�|�|j�t�	|�t�	|���t�
|�t|�|�|j�t�	|�t�	|���dS)N�1rd)rr?r@rArr3rr}rBr|rCrYrirrr�_test_samestat_on_link_funcs


�

�z'GenericTest._test_samestat_on_link_funccCrnrW)r�rBrorprrr�test_samestat_on_symlink rrz$GenericTest.test_samestat_on_symlinkc
Crsrt)r�rBrurvrwrxrrr�test_samestat_on_link$r{z!GenericTest.test_samestat_on_linkc	Cs�tj}|�tj|�t|�t|dd��9}|��}t|dd��}|��}|�|j�	||��Wd�n1s8wYWd�dSWd�dS1sPwYdS)NrFr)
rr?r@rArr	�filenor3r�sameopenfile)r#r�fp1�fd1�fp2�fd2rrr�test_sameopenfile*s��"�zGenericTest.test_sameopenfileN)r"�
__module__�__qualname__rrr%r<rDrJrU�unittest�
skipUnless�hasattrrBr\r`rbrhrmr�skip_unless_symlinkrqrzr�r�r�r�r�rrrrrs.C
	

rc@seZdZeZdd�ZdS)�TestGenericTestc
CsPtjD]�}|dkr
qt|j|�}|j|d���|dvr,|d�|d�|d�|d�nj|�ttf��|d�Wd�n1sBwY|�ttf��|d�Wd�n1s]wY|�	t
d��|d�Wd�n1swwY|�	t
d��|d�Wd�n1s�wYWd�n1s�wYqdS)	Nr)r$)rrru/tmp�abcdss
/tmp�abcdsz
/tmpabcdss
/tmpabcdsz
embedded null)rrrr�subTestr�OSError�UnicodeEncodeError�UnicodeDecodeError�assertRaisesRegex�
ValueError)r#r$rjrrr�test_invalid_paths<s4


�
�
�
�����z"TestGenericTest.test_invalid_pathsN)r"r�r�rQrr�rrrrr�6sr�c@s�eZdZejgd�Zdd�Zdd�Zdd�Ze�	e
jd�d	d
��Ze
�d�dd
��Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�
CommonTest)�curdir�pardir�extsep�sep�pathsep�defpath�altsep�devnull�normcase�
splitdrive�
expandvars�normpath�abspath�join�split�splitext�isabs�basename�dirnamerR�islink�ismount�
expanduserr��realpathcCs||jj}dD]}||�}|�|||��q|�|d�d�|�|d�d�ddddgtd�ddhfD]	}|�t||�q2dS)N)z	FoO/./BaRs	FoO/./BaRr&�Trg@�o)rr�r2�	bytearrayrr)r#r�r:�pathrrr�
test_normcase`s�zCommonTest.test_normcasecCsl|jj}|�|d�d�|�|d�d�|�|d�d�|�|d�d�|�|d	�d
�|�|d�d�dS)
N�/foo/bar)r&r��foo:bar)r&r��:foo:bar)r&r��/foo/bar)r�r��foo:bar)r�r��:foo:bar)r�r�)rr�r2)r#r�rrr�test_splitdrivenszCommonTest.test_splitdrivecCs�|jj}t����}|��d|d<d|d<d|d<|�|d�d�|�|d�d�|�|d	�d
�|�|d�d�|�|d�d�|�|d
�d
�|�|d�d�|�|d�d�|�|d�d�|�|d�d
�|�|d�d�|�|d�d�|�|d�d�|�|d�d�|�|d�d�|�|d�d�|�|d�d�|�|d�d�|�|d�d�|�|d �d!�|�|d"�d�|�|d#�d#�Wd�dS1s�wYdS)$N�bar�foo�baz1z{foo�baz2z{foo}z$foo barzbar barz	${foo}bar�barbarz	$[foo]barz$bar barz$?barz$foo}barzbar}barz${fooz${{foo}}zbaz1}z$foo$fooz$bar$barrs$foo barsbar bars	${foo}barsbarbars	$[foo]bars$bar bars$?bars$foo}barsbar}bars${foos${{foo}}sbaz1}s$foo$foos$bar$bar�rr�r�EnvironmentVarGuard�clearr2)r#r��envrrr�test_expandvarsys:
"�zCommonTest.test_expandvarszneed os_helper.FS_NONASCIIcsL�jj���fdd�}t����}|��tj}||d<d|||<|||�|dd|�|dd|�|d	|d
|�|d|d|�|dd
|�|t�|�t�|��|dt�d|��|dt�d|��|t�d	|�t�d
|��|t�d|�t�d|��|dt�d
|��Wd�dS1s�wYdS)Ncs���|�|�dSrW)r2)�value�expected�r�r#rr�check�sz2CommonTest.test_expandvars_nonascii.<locals>.check�spam�hamz	$spam barz%s barz
${spam}barz%sbarz${%s}barzham%sbarz
$bar%s barz	$spam}barz%s}bars	$spam bars
${spam}bars	$spam}bar)rr�rr�r��FS_NONASCIIrBrO)r#r�r��nonasciirr�r�test_expandvars_nonascii�s0

��"�z#CommonTest.test_expandvars_nonascii�cpucCs�|jj}t���O}|��d|d<d}|�|d|�d|�|�|d|�d|�|�|d|�d|�|�|d|�d	|�|�|d
|�d
|�Wd�dS1sZwYdS)N�B�Ai��z$Az${A}z$A!zB!z${A}A�BAz${${${${${${${${${${r�)r#r�r�r;rrr�test_expandvars_large�s
"�z CommonTest.test_expandvars_largecCs�|�d|j�d��t���t�dt�|�d|j�d��Wd�n1s)wYtjdkr5dnd}t���#t�dt�dd|ddfD]}|�	|j�|�t
�qIWd�dS1sawYdS)	Nr��ignorer�win32r�sf��s/foosC:\)�assertInrr��warnings�catch_warnings�simplefilter�DeprecationWarning�sys�platform�assertIsInstance�bytes)r#�undecodable_pathr�rrr�test_abspath�s
�
�"�zCommonTest.test_abspathcCsb|�d|j�d��t���t�dt�|�d|j�d��Wd�dS1s*wYdS)Nr�r�r)r�rr�r�r�r�r�rprrr�
test_realpath�s

"�zCommonTest.test_realpathcCs"dD]}|�|j�|�t�qdS)N)r&�.�/�\z///foo/.//bar//)r�rr��str)r#r�rrr�test_normpath_issue5827�s�z"CommonTest.test_normpath_issue5827c	Cs�|jj}dD]
}|�||�t�qd}zt�|�Wnttfy&YdSwt�	|��dD]
}|�||�t�q/Wd�dS1sEwYdS)N)r&�fuuufùùz/fuuzU:\uçwð)
rr�r�r�rBrO�AttributeErrorr�r�temp_cwd)r#r�r��unicwdrrr�test_abspath_issue3426�s��"�z!CommonTest.test_abspath_issue3426c	Cs�tjrtjdvrtj}ntjrtj}n|�d�t���0t�dt	�t�
|��|��Wd�n1s7wYWd�dSWd�dS1sOwYdS)N)r��darwinzneed os_helper.TESTFN_NONASCIIr�)r�TESTFN_UNDECODABLEr�r��TESTFN_NONASCIIrwr�r�r�r�r�r�)r#�namerrr�test_nonascii_abspath�s



��"�z CommonTest.test_nonascii_abspathc	Cs�tjdtfdd���d}|�t|��|j�dd�Wd�n1s$wY|�t|��|j�dd�Wd�n1sAwY|�td��|j�dd�Wd�n1s^wY|�td��|j�dd�Wd�n1s{wY|�td��|j�d�Wd�n1s�wY|�td	��|j�g�Wd�n1s�wY|�td
��|j�td�td��Wd�n1s�wYWd�dSWd�dS1s�wYdS)
Nr&T��quiet�.Can't mix strings and bytes in path components�bytesr��int�*�listr�rrE)r�check_warnings�BytesWarningr�rrr�r��r#�errmsgrrr�test_join_errors�s4��������"�zCommonTest.test_join_errorsc	Csztjdttffdd���d}|�t|��|j�dd�Wd�n1s&wY|�t|��|j�dd�Wd�n1sCwY|�td��|j�dd�Wd�n1s`wY|�td��|j�dd�Wd�n1s}wY|�td	��|j�td
�td��Wd�n1s�wYWd�dSWd�dS1s�wYdS)Nr&Tr�r�r�r�r�r�r�rrE)	rr�r�r�r�rr�relpathr�r�rrr�test_relpath_errorss,�������"�zCommonTest.test_relpath_errorscCstddd|jj�dS)Nz-Sz-czimport )rrr"rprrr�test_import!szCommonTest.test_importN)r"r�r�rrr�r�r�r�r�rr�r�r�requires_resourcer�r�r�r�r�r�r�rrrrrrr�Us"


r�c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�
PathLikeTestscCs4tj|_ttj�|_|�tj|j�t|jd�dS)Nstest_genericpath.PathLikeTests)rr?�	file_namer�	file_pathr@rArrprrr�setUp'szPathLikeTests.setUpcCs|�||j�||j��dSrW)r2rr)r#rjrrr�assertPathEqual-�zPathLikeTests.assertPathEqualcC�|�tjj�dSrW)rrBr�rrprrr�test_path_exists0�zPathLikeTests.test_path_existscCr	rW)rrBr�rrprrr�test_path_isfile3rzPathLikeTests.test_path_isfilecCr	rW)rrBr�rrprrr�test_path_isdir6rzPathLikeTests.test_path_isdircCs"|�tj�|j|jg�|j�dSrW)r2rBr�rrrrprrr�test_path_commonprefix9s�z$PathLikeTests.test_path_commonprefixcCr	rW)rrBr�rrprrr�test_path_getsize=rzPathLikeTests.test_path_getsizecCr	rW)rrBr�rrprrr�test_path_getmtime@rz PathLikeTests.test_path_getmtimecCr	rW)rrBr�rrprrr�test_path_getctimeCrz PathLikeTests.test_path_getctimecCs|�tj�|j|j��dSrW)r3rBr�rerrrprrr�test_path_samefileFrz PathLikeTests.test_path_samefileN)
r"r�r�rrr
rr
rrrrrrrrrr%sr�__main__)r)�__doc__rQrBr�r�r��testr�test.supportrr�test.support.script_helperr�test.support.os_helperrrr�TestCaser�r�rr"�mainrrrr�<module>s,
"Q%�

Youez - 2016 - github.com/yon3zu
LinuXploit