403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_platform.cpython-36.pyc
3

�w2_�B�@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
Gdd�dej�ZGdd�dej�Z
edkr�ej�dS)	�)�mockN)�supportc@seZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zejejjd�d�dd ��Zd!d"�Zd#d$�Zd%d&�Zejejd'kd(�d)d*��Zd+d,�Zd-d.�Zejd/d0��Z d1d2�Z!d3d4�Z"d5d6�Z#d7S)8�PlatformTestcCstj�}dS)N)�platformZarchitecture)�self�res�r�7/opt/alt/python36/lib64/python3.6/test/test_platform.py�test_architectureszPlatformTest.test_architecturecs�d}tjdkrndd�tjD�}djtjjtj�|jdd��|d<tjjtj�|d<t	j
d�rntjjtj�|d	<d
�fd
d�	}tjjtj�}tjj
tj�}tj||�z�j||�|||d��Wdtj|�XdS)N�win32cSsi|]}tj||j��qSr)�os�environ�upper)�.0�krrr	�
<dictcomp>sz>PlatformTest.test_architecture_via_symlink.<locals>.<dictcomp>z{};{}�PATH�Z
PYTHONHOMET�
PYTHONPATHcsj|ddg}tj|tjtj|d�}|j�}|jrftt|d��tt|d�tjd��j	dj
|j��|S)Nz-cz/import platform; print(platform.architecture()))�stdout�stderr�envr�)�filez'unexpected return code: {0} (0x{0:08X}))�
subprocess�Popen�PIPEZcommunicate�
returncode�print�repr�sysrZfail�format)�pythonr�cmd�p�r)rrr	�gets

z7PlatformTest.test_architecture_via_symlink.<locals>.get)r)N)r rrr
r!�path�dirname�
executabler&�	sysconfig�is_python_build�__file__�realpath�abspathr�TESTFN�symlink�assertEqual�remove)rrr&�real�linkr)rr	�test_architecture_via_symlinks


z*PlatformTest.test_architecture_via_symlinkcCs,x&dD]}xdD]}tj||�}qWqWdS)NFT)FT)FT)r)rZaliasedZterserrrr	�
test_platform3s

zPlatformTest.test_platformcCstj�}dS)N)r�system)rrrrr	�test_system8szPlatformTest.test_systemcCstj�}dS)N)r�node)rrrrr	�	test_node;szPlatformTest.test_nodecCstj�}dS)N)r�release)rrrrr	�test_release>szPlatformTest.test_releasecCstj�}dS)N)r�version)rrrrr	�test_versionAszPlatformTest.test_versioncCstj�}dS)N)r�machine)rrrrr	�test_machineDszPlatformTest.test_machinecCstj�}dS)N)r�	processor)rrrrr	�test_processorGszPlatformTest.test_processorcCstj|_tj|_tj|_dS)N)r r=�save_version�_git�save_gitr�
save_platform)rrrr	�setUpJszPlatformTest.setUpcCs|jt_|jt_|jt_dS)N)rCr r=rErDrFr)rrrr	�tearDownOszPlatformTest.tearDowncCsD�xBdTD]:\}}tj|�\}}}}}}}	|j||dd|||	f|�qWddU|jfdWdXdZd[d]d^d`dbddd3de|jfdgi}
x�|
j�D]�\\}}}
}|t_|dk�r�ttd7��r�t`n|t_|
dk	�r�|
t_|jtj	�|d8�|jtj
�|d9�|jtj�|d:�|jtj�|d;�|jtj
�|d<�|jtj�|d=��q|WdS)hN�C2.4.3 (#1, Jun 21 2006, 13:54:21) 
[GCC 3.3.4 (pre 3.3.5 20040809)]�CPython�2.4.3r�1�Jun 21 2006 13:54:21�GCC 3.3.4 (pre 3.3.5 20040809)�)IronPython 1.0.60816 on .NET 2.0.50727.42�
IronPython�	1.0.60816�.NET 2.0.50727.42�4IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42�1.0.0�"2.4.3 (truncation, date, t) 
[GCC]�
truncation�date t�GCC�!2.4.3 (truncation, date, ) 
[GCC]�date� 2.4.3 (truncation, date,) 
[GCC]�2.4.3 (truncation, date) 
[GCC]�2.4.3 (truncation, d) 
[GCC]�d�2.4.3 (truncation, ) 
[GCC]�2.4.3 (truncation,) 
[GCC]�2.4.3 (truncation) 
[GCC]zX2.6.1 (r261:67515, Dec  6 2008, 15:26:00) 
[GCC 4.0.1 (Apple Computer, Inc. build 5370)]�	tags/r261�67515�2.6.1�
r261:67515�Dec  6 2008 15:26:00�+GCC 4.0.1 (Apple Computer, Inc. build 5370)�/IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053�cli�2.0.0�.NET 2.0.50727.3053�=2.6.1 (IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433)�.NET 2.0.50727.1433�@2.7.4 (IronPython 2.7.4 (2.7.0.40) on Mono 4.0.30319.1 (32-bit))�2.7.4�Mono 4.0.30319.1 (32-bit)�^2.5 (trunk:6107, Mar 26 2009, 13:02:18) 
[Java HotSpot(TM) Client VM ("Apple Computer, Inc.")]�Jython�trunk�6107�java1.5.0_16�2.5.0�
trunk:6107�Mar 26 2009z12.5.2 (63378, Mar 26 2009, 18:03:29)
[PyPy 1.0.0]�PyPy�63378�2.5.2rDrr�����rJrKrrrLrMrN�rIr��rPrQrrrrrR�rOr��rPrTrrrrrR�rSr��rJrKrrrVrWrX�rUr��rJrKrrrVrZrX�rYr��rJrKrrrVrZrX�r[r��rJrKrrrVrZrX�r\r��rJrKrrrVr^rX�r]r��rJrKrrrVrrX�r_r��rJrKrrrVrrX�r`r��rJrKrrrVrrX�rar�)r�r�r�r�r�r�r�r�r�r�r�)rJrbrc�rerf)rJrdrbrcr�rg)rhNri�rr)rPrjrrr�rk)rlNri�rr)rPrdrrr�rm)rnNri�rr)rProrrr�rp�rrrsrt)rqr�ru�rwrx)rrrvrsrtr�ru)ryrsrz�rzrx)ryr{rsrzr�r)rZ_sys_versionr1rF�itemsr r=�hasattrrDZpython_implementationZpython_versionZ
python_branchZpython_revisionZpython_buildZpython_compiler)r�input�output�namer=ZbranchZrevisionZbuildnoZ	builddateZcompilerZsys_versionsZversion_tagZ
subversionZsys_platform�inforrr	�test_sys_versionTs~

zPlatformTest.test_sys_versioncCstjtj�tj�tj��}dS)N)rZsystem_aliasr7r;r=)rrrrr	�test_system_alias�szPlatformTest.test_system_aliascCs�tj�}|jt|��|j|d|j�|j|d|j�|j|d|j�|j|d|j�|j|d|j	�|j|d|j
�dS)Nrrr|r}r~r)r�uname�
assertTrue�anyr1r7r9r;r=r?rA)rrrrr	�
test_uname�szPlatformTest.test_uname�winzwindows only testcCs�z�tj��p}d|kr|d=d|d<dt_tj�\}}}}}}|j|d�d|d<dt_tj�\}}}}}}|j|d�WdQRXWddt_XdS)NZPROCESSOR_ARCHITEW6432ZfooZPROCESSOR_ARCHITECTUREZbar)rZEnvironmentVarGuardrZ_uname_cacher�r1)rr
r7r9r;r=r?rArrr	�test_uname_win32_ARCHITEW6432�s
z*PlatformTest.test_uname_win32_ARCHITEW6432cCs$tj�}tjdkr |jt|��dS)N�java)rZjava_verr r��all)rrrrr	�
test_java_ver�s
zPlatformTest.test_java_vercCstj�}dS)N)rZ	win32_ver)rrrrr	�test_win32_ver�szPlatformTest.test_win32_vercCs�tj�}tj�jdkr�tjdd�}d}x(|D] }|jd�r,|j�j�d}Pq,W|j	�|j
|dk�|djd�}|jd�}t|�t|�}|dkr�|jdg|�|j
||�|j
|dd�tjd
kr�|j|dd�n|j
|dd�dS)NZDarwinZsw_versr%zProductVersion:rr�.�0r�littler|�i386�x86_64ZPowerPC���)rrr)r�r�)r�mac_verr�r7r�popen�
startswith�strip�split�closeZassertFalse�len�extendr1r �	byteorderZassertIn)rr�fdZreal_ver�lnZresult_listZexpect_listZlen_diffrrr	�test_mac_ver�s(



zPlatformTest.test_mac_ver�darwinz
OSX only testcCsPtj�}|dkr$tj�}tjd�n(tj|d�\}}|j||�|j|d�dS)Nr)r�forkrr��_exit�waitpidr1)r�pidr�Zcpid�stsrrr	�test_mac_ver_with_fork�sz#PlatformTest.test_mac_ver_with_forkcCs.tj��tjddt�tj�}WdQRXdS)N�ignorez?dist\(\) and linux_distribution\(\) functions are deprecated .*)�warnings�catch_warnings�filterwarnings�PendingDeprecationWarningr�dist)rrrrr	�	test_dists
zPlatformTest.test_distcCs�tjjtj�r,tjjtjd�r,tjd}ntj}tj|�}|jt	j
t	j�tt	jd��}|j
dd	�|j
d�WdQRX|jtjt	j�d
�dS)Nz.exe�wb�xi@�
s"GLIBC_1.23.4GLIBC_1.9GLIBC_1.21�glibc�1.23.4i�?)r�r�)rr'�isdirr r)�existsrZlibc_verZ
addCleanupr�unlinkr/�open�writer1)rr)r�frrr	�
test_libc_vers
zPlatformTest.test_libc_vercCs|ddlm}|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d	��|j|d�|d
��|j|d	�|d��|j|d
�|d��|j|d�|d
��|j|d�|d
��|j|d
�|d��|j|d
�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d�|d��|j|d �|d!��|j|d"�|d#��|j|d"�|d ��|j|d!�|d#��|j|d �|d#��|j|d$�|d%��|j|d&�|d'��|j|d(�|d)��dS)*Nr)�_comparable_versionz1.2.3z1.2.10z1.2.3.4z1_2-3+4z1.2spamz1.2devz1.2alphaz1.2az1.2betaz1.2bz1.2cz1.2RCz1.2rcz1.2.0z1.2plz1.2pz1.5.1z1.5.2b2z3.10aZ161z8.02z3.4jz
1996.07.12z3.1.1.6z3.2.pl0Z2g6Z11gz0.9z2.2z1.2z1.2.1z1.1z1.2.2z0.4z0.4.0z1.13++z5.5.kwz0.960923z	2.2beta29)rr�r1Z
assertLess)r�Vrrr	�test__comparable_version&s@z%PlatformTest.test__comparable_versionc
Cs(x"d5D]\}}|jtj|�|�qWdS)6N�SuSE Linux 9.3 (x86-64)�SuSE Linux �9.3�x86-64�SUSE LINUX 10.1 (X86-64)�SUSE LINUX �10.1�X86-64�SUSE LINUX 10.1 (i586)�i586� Fedora Core release 5 (Bordeaux)�Fedora Core�5�Bordeaux�"Red Hat Linux release 8.0 (Psyche)�
Red Hat Linux�8.0�Psyche� Red Hat Linux release 9 (Shrike)�9�Shrike�+Red Hat Enterprise Linux release 4 (Nahant)�Red Hat Enterprise Linux�4�Nahant�CentOS release 4�CentOS�Rocks release 4.2.1 (Cydonia)�Rocks�4.2.1�Cydoniar�r�r�r��r�r��r�r�r��r�r��r�r�r��r�r�r�r�r��r�r�r�r�r��r�r�r�r�r��r�r�r�r�r��r�r	�r�r�N�r�r�r�r�r��r�r
�rrr�rr)
r�rrrrrr
rrr)r1rZ_parse_release_file)rr�r�rrr	�test_parse_release_fileJsz$PlatformTest.test_parse_release_filec	 Cstjdk}|rdjtj�}ndjtj�}tj��Htjdt�tj|��&}|j	�j
�}|j�|j|d�WdQRXWdQRXd}|r�d}nd}|jtj�}tj��ntjdt�tj|d	��J}|j
|�}|j�}|j|�tjd
kr�|}n|d?}|j|t|��WdQRXWdQRXdS)Nrz"{}" -c "print('Hello')"z'{}' -c 'print("Hello")'r�ZHelloZplopz<"{}" -c "import sys; data=sys.stdin.read(); exit(len(data))"z<'{}' -c 'import sys; data=sys.stdin.read(); exit(len(data))'�w�nt�)r rr!r)r�r��simplefilter�DeprecationWarningr��readr�r�r1r�ZassertIsNotNonerr�r�)	rZ	mswindowsZcommandrZhello�data�stdinZretrrrr	�
test_popen[s2

 



zPlatformTest.test_popenc Cs�tj���}tjj|d�}t|ddd��}|jd�WdQRXtjd|��Bt	j
��"t	jddt�t
j�\}}}WdQRX|j|d	�WdQRX|j|d
�|j|d�WdQRXdS)Nzfedora-releaserzutf-8)�encodingu)Fedora release 19 (Schrödinger’s Cat)
zplatform._UNIXCONFDIRr�z?dist\(\) and linux_distribution\(\) functions are deprecated .*ZFedoraZ19uSchrödinger’s Cat)�tempfileZTemporaryDirectoryrr'�joinr�r�rZpatchr�r�r�r�r�linux_distributionr1)rZtempdir�filenamer�Zdistnamer=Zdistidrrr	� test_linux_distribution_encoding{s

z-PlatformTest.test_linux_distribution_encodingN)$�__name__�
__module__�__qualname__r
rZskip_unless_symlinkr5r6r8r:r<r>r@rBrGrHr�r�r��unittestZ
skipUnlessr rr�r�r�r�r�r�r�r�Zcpython_onlyr�rrr rrrr	r
s2"W
!
$ rc@seZdZdd�Zdd�ZdS)�DeprecationTestc
Cs4|jt��}tj�WdQRX|jt|j�d�dS)NzFdist() and linux_distribution() functions are deprecated in Python 3.5)�assertWarnsr�rr�r1�str�warning)r�cmrrr	�test_dist_deprecation�sz%DeprecationTest.test_dist_deprecationc
Cs4|jt��}tj�WdQRX|jt|j�d�dS)NzFdist() and linux_distribution() functions are deprecated in Python 3.5)r&r�rrr1r'r()rr)rrr	�#test_linux_distribution_deprecation�sz3DeprecationTest.test_linux_distribution_deprecationN)r!r"r#r*r+rrrr	r%�sr%�__main__)r$rrrrr r*rr�ZtestrZTestCaserr%r!�mainrrrr	�<module>s 

Youez - 2016 - github.com/yon3zu
LinuXploit