Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.128.171.99
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_import.pyo
�
?��cc@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
mZmZmZmZmZmZmZddlmZddlmZd�Zd�Zd�Zde	jfd	��YZd
e	jfd��YZde	jfd
��YZde	jfd��YZde	jfd��YZ e!d�Z"e#dkr�ddl$m"Z"e"�ndS(i����N(tunlinktTESTFNtunloadtrun_unittesttrmtreet	is_jythontcheck_warningstEnvironmentVarGuard(tsymlink_support(t
script_helpercCsC|tjd|tjd|tjd|tjd|dfS(Ntpytpyctpyotpyws	$py.class(tostextsep(tname((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyt_filess
cCs]xVt|�D]H}ytj|d�Wq
tk
rT}|jtjkrU�qUq
Xq
WdS(Ni�(RRtchmodtOSErrorterrnotENOENT(Rtftexc((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pytchmod_filesscCs%xt|�D]}t|�q
WdS(N(RR(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pytremove_files"stImportTestscBs
eZd�ZeZd�Zd�Zd�Zeje	j
dkd�ejej
d�d���Zejej
d�d��Zd	�Zd
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCstt�dS(N(RR(tself((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttearDown)scCs5yddl}Wntk
r#nX|jd�dS(Ni����s3import of RAnDoM should have failed (case mismatch)(tRAnDoMtImportErrortfail(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_case_sensitivity-s

cCsddlm}dS(Ni����(tdouble_const(ttestR!(RR!((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_double_const7scs��fd�}tjjdtj�zW|tjd�tjjd�r{x-ddddd	d
gD]}||�qdWnWdtjd=XdS(Nc		s�t|}ttjd}tr.td}nttjd}t|d��X}|d|dfIJtjd�}tjd�}|dI|IJ|d	I|IJWdQXzuytt�}Wn*tk
r�}�j	d
||f�n5X�j
|j|d|��j
|j|d|�Wdt
|�XzHytjsJtj|�nWn$tk
rq}�j	d|�nXWdt
|�t
|�tt�XdS(
NRs	$py.classRtws)# This tests Python's ability to import asfile.i�sa =sb =simport from %s failed: %ss'module loaded (%s) but contents invalids import from .pyc/.pyo failed: %s(RRRRtopentrandomt	randranget
__import__RRtassertEqualtatbRtsystdont_write_bytecodetimptreloadR(	texttsourceRRRR*R+tmodterr(R(s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_with_extension=s>


		

iR
twins.PYs.Pys.pYs.pyws.PYWs.pYw(R,tpathtinsertRtcurdirRtplatformt
startswith(RR4R0((Rs7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_import<s'tposixs%test meaningful only on posix systemss*test meaningful only when writing bytecodecCsItjd�}tjjdtj�z�ttjd}t|d�j	�}tj
|tjtj
BtjBtjBtjBtjB�tt�|d}tjj|�s�|d}tjj|�s�|jd�q�ntj|�}|jtj|j�tjtj
BtjB�Wdtj|�tt�tt�tjd=XdS(NiiR
R$tctosC__import__ did not result in creation of either a .pyc or .pyo file(RtumaskR,R6R7R8RRR%tcloseRtstattS_IRUSRtS_IRGRPtS_IROTHtS_IXUSRtS_IXGRPtS_IXOTHR(texistsRR)tS_IMODEtst_modeRR(RtoldmasktfnameRtfnts((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_execute_bit_not_copiedms(	-





cCsotjjdtj�ttjd}zt|d��}|jd�WdQXtj	|�}tj
||j|jdf�tj
|d�tt�}|j|jd�tj
|d�t|d��}|jd	�WdQXtt�tt�}|j|jd
�t|�tt�tt�}|j|jd
�Wdtt�tt�tt�tjd=XdS(NiR
R$sx = 'original'
i�itoriginali�sx = 'rewritten'
t	rewritten(R,R6R7RR8RRR%twriteRAtutimetst_atimetst_mtimeRR(R)txRRRR(RRLRRNtm1tm2tm3((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyt&test_rewrite_pyc_with_read_only_source�s0 





cCs}tj}tj}t��\tjd�}tjd|�}|jt|�|j||j�|j||j�WdQXdS(NR(	RR6tgetenvRR.tfind_moduletload_moduletassertIstassertIsNot(Rt	orig_pathtorig_getenvRVtnew_os((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_imp_module�s
		
tlonglistcBs�|ejd}e|d��E}|jd�x!ed�D]}|jd�q=W|jd�WdQXe|d��}ej|�WdQXe|�ej	j
d�d	|dUej	d
=e|d�e|d�dS(
NR
sw+sd = [
i�s"",
t]trtsimport i����R=R>(RRR%RRtranget
py_compiletcompileRR,R6tappend(RtmoduletfilenameRti((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_module_with_large_stack�s


cCs�ttjd}t|d��}|dIJWdQXtjjdtj�zKxDdddgD]3}|jt	t
t�|jttjd|�q\WWdtjd=t
t�XdS(	NR
R$s
a = 1 // 0iiiis'damaged module in sys.modules on %i try(RRRR%R,R6R7R8tassertRaisestZeroDivisionErrorR(tassertNotIntmodulesR(RR1RRn((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_failing_import_sticks�s
cCsettjd}t|d��}|dIJ|dIJWdQXtjjdtj�z�tt�}|j	ttj
�|j|jdd�|j|j
dd�tt�t|d��}|d	IJ|d
IJWdQX|jttj|�tj
jt�}|j|dd�|j|jdd�|j|j
dd�Wdtjd=tt�tt�XdS(
NR
R$sa = 1sb = 2iis!module has wrong attribute valuesisa = 10s	b = 20//0s$expected module to be in sys.modulesi
(RRRR%R,R6R7R8R(tassertInRsR)R*R+RRpRqR.R/tgetR_tNoneR(RR1RR2((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_failing_reload�s,




cCsAtjjdtjjt��zddl}Wdtjd=XdS(Nii����(R,R6R7Rtdirnamet__file__tinfinite_reload(RR{((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_infinite_reloadscCssddl}ddl}|j|||j�|jt|jd��ddlj}|j||j|j�dS(Ni����Rz(R"ttest.test_supportR^t__name__t
assertTruethasattrttest_support(RRVR"ty((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_import_name_binding!scCs0tdtf��|jttd�WdQXdS(NRgs
site-packages(Rt
ImportWarningRpRR((R((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyt&test_import_initless_directory_warning,scCsRtjjt�}|jt��}t|�WdQX|jd|jj	d�dS(Ns$Import by filename is not supported.i(
RR6tabspathRRpRR(R)t	exceptiontargs(RR6R=((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_import_by_filename2s
	cCsAtjdttjd��}ztj|�Wdt|�XdS(NRgs�            import sys
            class C:
               def __del__(self):
                  import imp
            sys.argv.insert(0, C())
            (R	tmake_scriptRttextwraptdedenttassert_python_okR(Rttestfn((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyt!test_import_in_del_does_not_crash9s
cCsRtd}tj|�z&|jttftjtdg�Wdtj|�XdS(Ns.pyt.(	RRtmkdirRpRtIOErrorR.R\trmdir(RR1((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_bug7732Gs

cCs	tjjdtj�z�td}|tr2dnd}t|d��}WdQXytj|d
df�Wngt	k
r�|j
d	�nJtk
r�}|jt
td
d�kr��n|j
dj|��nXtt�tj|�Wdtjd=tt�XdS(Nis.pyR=R>R$ii!is-cannot set modification time to large integert	EOVERFLOWs2cannot set modification time to large integer ({})II����II����(R,R6R7RR8Rt	__debug__R%RSt
OverflowErrortskipTestRRtgetattrRwtformatR(RAR(RR1tcompiledRte((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_timestamp_overflowPs$



c
Csvtjjdtj�zHd}d}x5t||�D]$\}}t|}|d}|trddnd}t|d	��}|j	d
�WdQXtj
|||f�t|�}	tjj|�s�t
|�|jd�nttj|�j�d@}
t|d
��*}tjd|jd�d�d}WdQXt
|�t
|�|j|
|�q5WWdtjjd�XdS(Nii��Ni��Otspamteggss.pyR=R>R$s# Just testing
x=1, 2, 3
sCouldn't create .pyc/.pyo file.I����trbs<Lii(i��Ni��O(R�R�(R,R6R7RR8tzipRR�R%RRRSR(RHRR�tintRARUtstructtunpacktreadR)tpop(RtmtimesttailstmtimettailRlR1R�Rtmtmtime1tmtime2((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_pyc_mtimehs,


)

cCs�tjjt�}tj|�|jt|�tjj|d�}tj|�ttjj|d�d��}|j	d�WdQXttjj|d�d��}|j	d�WdQXt
jjd|�|jt
jjd�ddl
}dS(	Ntsas__init__.pyR$s	import v1sv1.pys>import sys;sys.modules['sa'] = sys.modules[__name__];import saii����(RR6R�RR�t
addCleanupRtjoinR%RRR,R7R�R�(Rtdir_nametpkg_dirt	init_filetv1_fileR�((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyt"test_replace_parent_in_sys_modules�s

!!c	Cs�|jt��}tdddg�WdQX|jdt|j��|jt��}tdddg�WdQX|jdt|j��dS(Nt	encodingstfromlistualiasessmust be str, not unicodeismust be str, not int(Rpt	TypeErrorR(RutstrR�(Rtcm((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_fromlist_type�s(R~t
__module__RtsetUpR R#R;tunittestt
skipUnlessRRtskipIfR,R-RORZRcRoRtRxR|R�R�R�R�R�R�R�R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR's2		
		1#			)	
								(	tPycRewritingTestscBs�eZdZdZejje�Zejj	ee�ej
dZeerSdndZ
d�Zd�Zd�Zd�Zd	�Zd
�Zd�ZRS(tunlikely_module_names�
import sys
code_filename = sys._getframe().f_code.co_filename
module_filename = __file__
constant = 1
def func():
    pass
func_filename = func.func_code.co_filename
R
R=R>cCs}tj|_tjj|jd�|_tj	|j
�t|jd��}|j
|j�WdQXtjjd|j
�dS(NR$i(R,R6tsys_pathRsR�tmodule_nameRwtorig_moduleRR�R�R%t	file_nameRRt
module_sourceR7(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR��s
cCsj|jtj(|jdk	r2|jtj|j<n
t|j�t|j	�t|j
�t|j�dS(N(
R�R,R6R�RwRsR�RRR�t
compiled_nameRR�(R((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR�s



cCs*t�}t|j||�tj|jS(N(tglobalsR(R�R,Rs(Rtns((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyt
import_module�s	cCs�|j�}|j|j|j�|j|j|j�|j|j|j�tj|j=|j�}tj	s�|j|j|j
�n|j|j|j�|j|j|j�dS(N(R�R)tmodule_filenameR�t
code_filenamet
func_filenameR,RsR�R-R�(RR2((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_basics�s
	cCshtj|jdd�|j�}|j|j|j�|j|j|j�|j|j|j�dS(Ntdfilesanother_module.py(	RiRjR�R�R)R�R�R�R�(RR2((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_incorrect_code_name�s
cCsxd}tj|jd|�tj|j�|j�}|j|j|j�|j|j	|�|j|j
|�dS(Nsanother_module.pyR�(RiRjR�RtremoveR�R)R�R�R�R�(RttargetR2((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_module_without_source�scCsAtj|j�t|jd��%}|jd�}tj|�}WdQXt|j	�}t
j}|jd�}|||<t
|�|j|j|j|j|jt|�|j|j|j|j|j|j|j|j�}t|jd��$}|j|�tj||�WdQX|j�}|j|j j|j�dS(NR�iitwb(!RiRjR�R%R�R�tmarshaltloadtlistt	co_constst	test_maint	func_codetindexttypetco_argcountt
co_nlocalstco_stacksizetco_flagstco_codettupletco_namestco_varnamestco_filenametco_nametco_firstlinenot	co_lnotabtco_freevarstco_cellvarsRRtdumpR�R)tconstant(RRtheadertcodet	constantstforeign_codetposR2((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_foreign_code�s$	

(R~R�R�R�RR6R�RR�R�RR�R�R�R�RR�R�R�R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR��s	 		
					t
PathsTestscBsJeZeZd�Zd�Zd�Zd�Zej	dkrHeZ
nRS(cCs!tj|j�tj|_dS(N(RR�R6R,tsyspath(R((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR�scCst|j�|jtj(dS(N(RR6R�R,(R((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyRs
cCs{ttjj|jd�d��}|jd�WdQXtjj|jd�td�}|j|j	d�t
d�dS(Nstest_trailing_slash.pyR$s testdata = 'test_trailing_slash't/ttest_trailing_slash(R%RR6R�RRR,RkR(R)ttestdataR(RRR2((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR�s$c	Cs+ttjj|jd�d��}|jd�WdQXtjj|j�}ddl}|j�}|d}d||f}||d7}ytj|�WnNt	k
r�}|j
t
jt
jt
j
fkr�|jd|f�n�nXtjj|�td	�}|j|jd	�td	�dS(
Nstest_trailing_slash.pyR$s testdata = 'test_trailing_slash'i����is\\%s\%s$is%cannot access administrative share %rR�(R%RR6R�RRR�tsockettgethostnametlistdirRRtEPERMtEACCESRR�R,RkR(R)R�R(	RRR6R�thntdrivetuncR�R2((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyt_test_UNC_paths$$
!twin32(R~R�RR6R�RR�RR,R9t
test_UNC_path(((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR�s					tRelativeImportTestscBs2eZd�ZeZd�Zd�Zd�ZRS(cCstd�dS(Nstest.relimport(R(R((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR6scCs*ddlm}|jt|d��dS(Ni(t	relimportR(RgRRR�(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_relimport_star:scs$�fd�}�fd�}tdddd��|�|�tdddd��|�|�tdddd��td	tf��|�WdQX|jt|�tdddd��td	tf��|�WdQX|jt|�tdt���|jt|�|jt|�dS(
Ncsd�UdS(Nsfrom os import path(((R�(s7/usr/local/python-2.7/lib/python2.7/test/test_import.pytcheck_absoluteAscsd�UdS(Nsfrom . import relimport(((R�(s7/usr/local/python-2.7/lib/python2.7/test/test_import.pytcheck_relativeCst__package__R"R~stest.notarealmodulesnotarealpkg.notarealmoduletfoos.+foo(tdictRtRuntimeWarningRptSystemErrortobjectt
ValueError(RRR	((R�s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_issue3221?s&

cCs7|jt��"ddlm}|jd�WdQXdS(Ni(tseps>explicit relative import triggered an implicit absolute import(RpRRRR(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyt#test_absolute_import_without_futureas(R~R�RR�RRR(((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR4s
			"tTestSymbolicallyLinkedPackagecBsoeZdZd�Zed��Zejee	d�pIe	j
�d	kd�ejd���Z
d�ZRS(
tsamplecCs�tjj|j�r(tj|j�ntjj|j�rPtj|j�nt	j|_
tj|j�tjj|jd�}t
|d�j�tj|j|j�dS(Ns__init__.pyR$(RR6RHttaggedtshutilRtpackage_nameRtremove_symlinkR,t
orig_sys_pathR�R�R%R@tsymlink(RR�((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR�ns
cCs|jdS(Ns-tagged(R(R((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR�stgetwindowsversioniisWindows Vista or later requiredcCsdgtj(t|j�dS(NR�(R,R6R(R(R((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyttest_symlinked_dir_importable�s
cCsatjj|j�r(tj|j�ntjj|j�rPtj|j�n|j	t
j(dS(N(RR6RHRRRRRRRR,(R((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR�s
(ii(R~R�RR�tpropertyRR�R�R�R,RRtskip_unless_symlinkRR(((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyRks	cCstttttt�dS(N(RRR�R�RR(tverbose((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyR��st__main__(R�(%RR.R�RRiR&RAR�R,R�R�RR}RRRRRRRRR"RR	RRRtTestCaseRR�R�RRRwR�R~ttest.test_import(((s7/usr/local/python-2.7/lib/python2.7/test/test_import.pyt<module>s6:			��[/71
© 2025 GrazzMean