OwlCyberSecurity - MANAGER
Edit File: platform.cpython-38.opt-1.pyc
U ����e5d�����������������������@���sl��d�Z�dZdZddlZddlZddlZddlZddddddd d d d d� Ze�d�Z d d��Z e�dej�Zdwdd�Z dxdd�Ze�d�Zdydd�Zddddddd d!d"d#d$d%�Zdd&d'd(d)d*d+�Zd,d-��Zd.d/��Zdzd0d1�Zd2d3��Zd{d5d6�Zd7d8��Zd|d9d:�Zd;d<��Zd=d>��Zd}d?d@�ZdAdB��Zd~dCdD�ZddEdF�ZdGdHdId�Z ej!ddfdJdK�Z"e�#dLdM�Z$da%dNdO��Z&dPdQ��Z'dRdS��Z(dTdU��Z)dVdW��Z*dXdY��Z+dZd[��Z,e�d\ej�Z-e�d]ej�Z.e�d^�Z/e�d_�Z0i�Z1d�d`da�Z2dbdc��Z3ddde��Z4dfdg��Z5dhdi��Z6djdk��Z7dldm��Z8dndo��Z9i�Z:d�dpdq�Z;e<drk�rhdsej=k�p8dtej=kZ>duej=k�oNdvej=kZ?e@e;e?e>���e�Ad��dS�)�a8�� This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as part of a filename. a�� Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee or royalty is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation or portions thereof, including modifications, that you make. EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE ! z1.0.8�����N� ������������(����2��������) ZdevZalpha�aZbeta�b�cZRCZrc�pl�pz([0-9]+|[._+-])c�������������� ���C���sb���g�}t��|��D�]N}|dkrzt|d�}d}W�n �tk rL���t�|d�}Y�nX�|�||f��q|S�)Nz._+-r����d���r���)� _component_re�split�int� ValueError�_ver_stages�get�extend)�version�result�v�t��r���� /usr/lib64/python3.8/platform.py�_comparable_version����s���� r���sC���(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)����@��c�������������� ���C���s���|�dkrZz0t��d�}|jdd�}t|�dkr6t|�W�S�W�n�tttfk rR���Y�nX�tj }�t }tt�jd�rvt�j� |��}�t|�d���`}|�|�}d} | t|�k��r�d |ks�d |kr�t�|| �} nd} | r�| ���t|�k�r|�|�}|�r|t| t|�d��d��|�}d} q�| �s�q�dd ��| ���D��\}} }}}}|�rF|�sFd}n�| �rx|dk�r`d}|}n||�||�k�r�|}n\|�r�|dk�r�d}|�r�|�r�||�||�k�r�|}|�r�|t|��d��|k�r�||�}| ���} q�W�5�Q�R�X�||fS�)a�� Tries to determine the libc version that the file executable (which defaults to the Python interpreter) is linked against. Returns a tuple of strings (lib,version) which default to the given parameters in case the lookup fails. Note that the function has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc. The file is read and scanned in chunks of chunksize bytes. N�CS_GNU_LIBC_VERSION����)�maxsplit�����realpath�rbr���s���libcs���GLIBCi���c�����������������S���s"���g�|�]}|d�k r|��d�n|�qS�)N�latin1)�decode)�.0�sr���r���r���� <listcomp>����s����zlibc_ver.<locals>.<listcomp>Zlibc�glibc)�os�confstrr����len�tuple�AttributeErrorr����OSError�sys� executabler����hasattr�pathr"����open�read�_libc_search�search�end�max�groups)r1����libr���Z chunksize�ver�parts�V�fZbinary�pos�m�chunkZlibcinitr)���ZglibcversionZsoZthreadsZ soversionr���r���r����libc_ver����s^���� � rC���c�����������������C���s`���|���d�}|r|�|��zttttt|���}W�n�tk rH���|}Y�nX�d�|dd���}�|�S�)z� Normalize the version and build strings and return a single version string using the format major.minor.build (or patchlevel). �.N����)r����append�list�map�strr���r����join)r����build�lZstringsr���r���r���� _norm_version����s���� rM���z'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])��win32�win16�dosc����������� ������C���s����t�j|kr|�||fS�ddl}dD�]R}z|j||jddd�}W�n0�t|jfk rl�}�zW�Y��q W�5�d}~X�Y�q X��q~q |�||fS�|���}t� |�}|dk r�|� ��\}�}}|d�dkr�|dd��}|d�dkr�|dd��}t|�}|�||fS�)a+�� Tries to figure out the OS version used and returns a tuple (system, release, version). It uses the "ver" shell command for this which is known to exists on Windows, DOS. XXX Others too ? In case this fails, the given parameters are used as defaults. r���N)r<���zcommand /c verz cmd /c verT)�stderr�text�shell���rD���)r0����platform� subprocess�check_output�DEVNULLr/����CalledProcessError�strip�_ver_output�matchr:���rM���) �system�releaser���Zsupported_platformsrW����cmd�infoZwhyrA���r���r���r����_syscmd_ver��s0���� � rb���Z2000ZXPZ 2003ServerZpost2003�Vista�7�8z8.1zpost8.1Z10Zpost10))����r���)rf���r����rf���r!���)rf���N�����r����ri���r����ri���r!����ri���rE����ri���N)r���r���)r���NZ 2008ServerZ2008ServerR2Z 2012ServerZ2012ServerR2Zpost2012ServerR2)rg���rh���rj���rk���rl���rm���c�������������������C���s ���t���dkS�)N)ZIoTUAPZ NanoServerZWindowsCoreHeadlessZ IoTEdgeOS)� win32_editionr���r���r���r����win32_is_iotO��s����ro���c��������������� ���C���s����z.zdd�l�}�W�n�tk r*���dd�l}�Y�nX�W�n�tk rB���Y�nTX�z<d}|��|�j|�� }|��|d�d�W��5�Q�R���W�S�Q�R�X�W�n�tk r����Y�nX�d�S�)Nr����,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ EditionId)�winreg�ImportError�_winreg� OpenKeyEx�HKEY_LOCAL_MACHINE�QueryValueExr/���)rq����cvkey�keyr���r���r���rn���R��s����(rn���c�������������� ���C���s���zddl�m}�W�n �tk r0���|�|||f�Y�S�X�|��}z ttt��d��d��\}}}W�n,�tk r����|jpx|d�d��\}}}Y�nX�d� |||�}t �||f�p�t �|d�f�p�|�}�|d�d��||fk�rzd� |j�}W�n8�t k �r���|d�d��d k�rd |dd����}Y�nX�t|dd��dk�rJt�||f��pHt�|d�f��pH|�}�z0zdd�l} W�n�tk �rv���dd�l} Y�nX�W�n�tk �r����Y�nLX�z2d} | �| j| ��}| �|d �d�}W�5�Q�R�X�W�n�tk �r����Y�nX�|�|||fS�)Nr���)�getwindowsversionr!���rD���rE���z{0}.{1}.{2}zSP{}� ���z Service Pack ZSPZproduct_typerp���ZCurrentType)r0���ry���rr���rH���r���rb���r���r���Zplatform_version�format�_WIN32_CLIENT_RELEASESr���Zservice_pack_majorr.����getattr�_WIN32_SERVER_RELEASESrq���rs���rt���ru���rv���r/���)r_���r����csd�ptypery���Zwinver�major�minorrK���rq���rw���rx���r���r���r���� win32_verd��sR���� ����r����c��������������� ���C���s����d}�t�j�|��sd�S�zdd�l}W�n�tk r6���Y�d�S�X�t|�d��}|�|�}W�5�Q�R�X�|d�}d}t����j}|dkrzd}|||fS�)Nz0/System/Library/CoreServices/SystemVersion.plistr���r#���ZProductVersion�r���r���r���)ZppczPower MacintoshZPowerPC) r*���r3����exists�plistlibrr���r4����load�uname�machine)�fnr����r?���r���r_����versioninfor����r���r���r����_mac_ver_xml���s���� r����r����c�����������������C���s���t���}|dk r|S�|�||fS�)a<�� Get macOS version information and return it as tuple (release, versioninfo, machine) with versioninfo being a tuple (version, dev_stage, non_release_version). Entries which cannot be determined are set to the parameter values which default to ''. All tuple entries are strings. N)r����)r_���r����r����ra���r���r���r����mac_ver���s����r����c�����������������C���sH���ddl�m}�z|�|��}|d�kr&|W�S�|W�S��tk rB���|�Y�S�X�d�S�)Nr���)�System)� java.langr����ZgetPropertyr.���)�name�defaultr�����valuer���r���r���� _java_getprop���s���� r����c�����������������C���s����zddl�}W�n �tk r,���|�|||f�Y�S�X�td|�}td|��}�|\}}}td|�}td|�}td|�}|||f}|\}} } td| �} td |�}td | �} || | f}|�|||fS�)a]�� Version interface for Jython. Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being a tuple (vm_name, vm_release, vm_vendor) and osinfo being a tuple (os_name, os_version, os_arch). Values which cannot be determined are set to the defaults given as parameters (which all default to ''). r���Nzjava.vendorzjava.versionzjava.vm.namezjava.vm.vendorzjava.vm.versionzjava.os.archzjava.os.namezjava.os.version)r����rr���r����)r_����vendor�vminfo�osinfo�javaZvm_nameZ vm_releaseZ vm_vendor�os_name� os_version�os_archr���r���r����java_ver���s"���� r����c�����������������C���s����|�dkr�|dk�r|�||fS�|��d�}|rlzt|d��}W�n�tk rL���Y�n X�|d�}t|�|d<�d�|�}|dk�rzd}�q�d}�n,|�dkr�d }�|r�|d �}q�d}n|�dkr�d }�|�||fS�)z� Returns (system, release, version) aliased to common marketing names used for some systems. It also does some reordering of the information in some cases where it would otherwise cause confusion. ZSunOS�5rD���r���rE����6ZSolarisZIRIX64ZIRIXz (64bit)�64bit�rO���rP����Windows)r���r���r���rI���rJ���)r^���r_���r���rL���r����r���r���r����system_alias���s.���� r����c������������������G���s����d��dd��tt|��D���}|�dd�}|�dd�}|�dd�}|�dd�}|�d d�}|�d d�}|�dd�}|�dd�}|�d d�}|�dd�}||kr�q�|}q�|d�dkr�|dd��}q�|S�)zq Helper to format the platform string in a filename compatible format e.g. "system-version-machine". �-c�����������������s���s���|�]}|����V��qd�S�)N)r[���)r&����xr���r���r���� <genexpr>(��s�����z_platform.<locals>.<genexpr>� �_�/�\�:�;�"�(�)�unknownr���z--rU���N)rJ����filterr,����replace)�argsrV���Zcleanedr���r���r���� _platform"��s"����r����c�����������������C���sN���zddl�}W�n�tk r$���|��Y�S�X�z |���W�S��tk rH���|��Y�S�X�dS�)z8 Helper to determine the node name of this machine. r���N)�socketrr���Zgethostnamer/���)r����r����r���r���r����_nodeB��s���� r����c�����������������C���sB���t�j�|��}�t�j�|��r>t�j�t�j�t�j�|��t��|����}�q|�S�)zT In case filepath is a symlink, follow it until a real file is reached. )r*���r3����abspath�islink�normpathrJ����dirname�readlink)�filepathr���r���r����_follow_symlinksQ��s�����r����c�������������� ���C���s\���t�jdkr|S�ddl}z|jd|�f|jdd�}W�n�t|jfk rN���|�Y�S�X�|���pZ|S�)z. Interface to the system's uname command. �rQ���rO���rP���r���Nr����T)rR���rS���)r0���rV���rW���rX���rY���r/���rZ���r[���)Zoptionr����rW����outputr���r���r���� _syscmd_uname\��s���� � r����c�������������� ���C���sz���t�jdkr|S�ddl}t|��}�ttjdd�}z|jdd|�g|j|d�}W�n�t |j fk rf���|�Y�S�X�|sp|S�|�d �S�) z� Interface to the system's file command. The function uses the -b option of the file command to have it omit the filename in its output. Follow the symlinks. It returns default in case the command should fail. r����r���N�C)�LC_ALL�filez-b)rR����envzlatin-1)r0���rV���rW���r�����dictr*����environrX���rY���r/���rZ���r%���)�targetr����rW���r����r����r���r���r����_syscmd_filem��s���� � r����)r���� WindowsPE)r���r����)r����MSDOSc�����������������C���s��|s&ddl�}|�d�}t|d��d�}|�r6t|�d�}nd}|sx|�tjkrxtjtkrpttj�\}}|rh|}|rp|}||fS�d|kr�d|kr�||fS�d |kr�d }nd|kr�d}nd |kr�d}d|kr�d}n8d|kr�d|kr�d}q�d}nd|kr�d}nd|kr�d}n�||fS�)a��� Queries the given executable (defaults to the Python interpreter binary) for various architecture information. Returns a tuple (bits, linkage) which contains information about the bit architecture and the linkage format used for the executable. Both values are returned as strings. Values that cannot be determined are returned as given by the parameter presets. If bits is given as '', the sizeof(pointer) (or sizeof(long) on Python version < 1.5.2) is used as indicator for the supported pointer size. The function relies on the system's "file" command to do the actual work. This is available on most if not all Unix platforms. On some non-Unix platforms where the "file" command does not exist and the executable is set to the Python interpreter binary defaults from _default_architecture are used. r���N�P�����bitr���r1���z shared objectz32-bit�32bitZN32Zn32bitz64-bitr����ZELFZPEr����r����ZCOFFzMS-DOSr����)�structZcalcsizerI���r����r0���r1���rV����_default_architecture)r1����bits�linkager�����sizeZfileoutr ���rL���r���r���r����architecture���sH���� � r�����uname_resultz-system node release version machine processorc������������������C���s���d}�t�dk rt�S�d}zt���\}}}}}W�n�tk rB���d}�Y�nX�|�sbttd|||||f���s�|�r~tj}d}d}t��}d}d}|dkr�t ��\}}}} |r�|r�d}|s�dtj kr�tj �dd�}ntj �dd�}|s�tj �d|�}|�r:t|�\}}}|d k�rd }n4|dk�r:|d k�r:d }d|dd ��k�r6d}nd}|dk�rd|�s^|dk�rZd}nd}d }n8|dd��dk�r�t ��\}} }}d}d�|�}|�s�| }|dk�r|�r�|dk�r�|}d}zddl} W�n�tk �r����Y�n&X�| �dd�\}}|dk�rd}nd}|�stdd�}|dk�r$d}|dk�r2d}|dk�r@d}|dk�rNd}|dk�r\d}|dk�rjd}|dk�r�|d k�r�d }d}t||||||�a�t�S�)an�� Fairly portable uname interface. Returns a tuple of strings (system, node, release, version, machine, processor) identifying the underlying platform. Note that unlike the os.uname function this also returns possible processor information as an additional tuple entry. Entries which cannot be determined are set to ''. r���Nr���r���rO���ZPROCESSOR_ARCHITEW6432ZPROCESSOR_ARCHITECTUREZPROCESSOR_IDENTIFIERzMicrosoft Windowsr����Z Microsoftz6.0rE���rc���r����r����Z16bit����r�����Javaz, ZOpenVMS�0zSYI$_CPU����ZAlphaZVAXz-pr����)�_uname_cacher*���r����r.���rG���r����r0���rV���r����r����r����r���rb���r����rJ����vms_librr���Zgetsyir����r����)Zno_os_uname� processorr^����noder_���r���r����Zuse_syscmd_verr���r����r����r����r����r����ZcsidZ cpu_numberr���r���r���r�������s����� ��r����c�������������������C���s���t���jS�)z� Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'. An empty string is returned if the value cannot be determined. )r����r^���r���r���r���r���r^���u��s����r^���c�������������������C���s���t���jS�)z� Returns the computer's network name (which may not be fully qualified) An empty string is returned if the value cannot be determined. )r����r����r���r���r���r���r����~��s����r����c�������������������C���s���t���jS�)z� Returns the system's release, e.g. '2.2.0' or 'NT' An empty string is returned if the value cannot be determined. )r����r_���r���r���r���r���r_������s����r_���c�������������������C���s���t���jS�)z� Returns the system's release version, e.g. '#3 on degas' An empty string is returned if the value cannot be determined. )r����r���r���r���r���r���r������s����r���c�������������������C���s���t���jS�)zt Returns the machine type, e.g. 'i386' An empty string is returned if the value cannot be determined. )r����r����r���r���r���r���r�������s����r����c�������������������C���s���t���jS�)a�� Returns the (true) processor name, e.g. 'amdk6' An empty string is returned if the value cannot be determined. Note that many platforms do not provide this information or simply return the same value as for machine(), e.g. NetBSD does this. )r����r����r���r���r���r���r�������s���� r����zL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?c�����������������C���s��|�dkrt�j}�t�|�d�}|dk r&|S�d|�kr�d}|��d�rHt�|��}n t�|��}|dkrjtdt |�����|� ��\}}}d}d}n�t�j�d�r�d}t�|��}|dkr�tdt |�����|� ��\}}}} } |dkr�d}t�j}n�d|�k�r"d}t �|��}|dk�rtd t |�����|� ��\}}}} d}n\t�|��}|dk�rFtd t |�����|� ��\}}}} }d}|dk�rld}n| �r~|d�| �}tt�d ��r�t�j\} }}n"tt�d��r�t�j\} }}nd}d}|�d�} t| �dk�r�| �d��d�| �}|||||||f}|t|�<�|S�)a��� Returns a parsed version of Python's sys.version as tuple (name, version, branch, revision, buildno, builddate, compiler) referring to the Python implementation name, version, branch, revision, build number, build date/time as string and the compiler identification string. Note that unlike the Python sys.version, the returned value for the Python version will always include the patchlevel (it defaults to '.0'). The function returns empty strings for tuple entries that cannot be determined. sys_version may be given to parse an alternative version string, e.g. if the version was read from a different Python interpreter. NZ IronPythonz*failed to parse IronPython sys.version: %sr���r����ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr�����_git� _mercurialrD���r!���r����)r0���r����_sys_version_cacher���� startswith�_ironpython_sys_version_parserr]���� _ironpython26_sys_version_parserr����reprr:���rV����_sys_version_parser�_pypy_sys_version_parserr2���r����r����r���r,���rF���rJ���)�sys_versionr���r����r]���r���Zalt_versionZcompilerZbuildnoZ builddateZ buildtimer�����branchZrevisionrL���r���r���r����_sys_version���s����� �� �� � ��� r����c�������������������C���s ���t���d�S�)aR�� Returns a string identifying the Python implementation. Currently, the following implementations are identified: 'CPython' (C implementation of Python), 'IronPython' (.NET implementation of Python), 'Jython' (Java implementation of Python), 'PyPy' (Python implementation of Python). r����r����r���r���r���r����python_implementation5��s����r����c�������������������C���s ���t���d�S�)z� Returns the Python version as string 'major.minor.patchlevel' Note that unlike the Python sys.version, the returned value will always include the patchlevel (it defaults to 0). r���r����r���r���r���r����python_versionB��s����r����c�������������������C���s���t�t��d��d��S�)z� Returns the Python version as tuple (major, minor, patchlevel) of strings. Note that unlike the Python sys.version, the returned value will always include the patchlevel (it defaults to 0). r���rD���)r-���r����r���r���r���r���r����python_version_tupleL��s���� r����c�������������������C���s ���t���d�S�)z� Returns a string identifying the Python implementation branch. For CPython this is the SCM branch from which the Python binary was built. If not available, an empty string is returned. r!���r����r���r���r���r���� python_branchW��s����r����c�������������������C���s ���t���d�S�)z� Returns a string identifying the Python implementation revision. For CPython this is the SCM revision from which the Python binary was built. If not available, an empty string is returned. rE���r����r���r���r���r����python_revisione��s����r����c�������������������C���s���t���dd��S�)zh Returns a tuple (buildno, builddate) stating the Python build number and date as strings. r����ri���r����r���r���r���r����python_buildr��s����r����c�������������������C���s ���t���d�S�)zS Returns a string identifying the compiler used for compiling Python. ri���r����r���r���r���r����python_compilerz��s����r����c�����������������C���sb��t��|�|fd�}|dk r|S�t��\}}}}}}||kr:d}|�rPt|||�\}}}|dkrnt��d�} | rnd}| }|dkr�t|�\} }}} |r�t||�}nt||||�}n�|dkr�ttj �\}}t||||d||��}n~|d k�r t ��\}}}\}}}|s�|�s t|||�}nt|||d |||�}n2|�r2t||�}n ttj �\}}t||||||�}|t�|�|f<�|S�)a��� Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is true, the function will use aliases for various platforms that report system names which differ from their common names, e.g. SunOS will be reported as Solaris. The system_alias() function is used to implement this. Setting terse to true causes the function to return only the absolute minimum information needed to identify the platform. Nr���ZDarwinr���ZmacOSr����)ZLinux�withr����Zon)�_platform_cacher���r����r����r����r����r����rC���r0���r1���r����r����)�aliased�terser���r^���r����r_���r���r����r����Z macos_releaseZrelZversr���r����rV���ZlibcnameZlibcversion�rr���r����r����r����r����r����r����r���r���r���rV������sX���� � ������rV����__main__r����z--terseZ nonaliasedz--nonaliased)Nr���r���r���)r���)r���r���r���rN���)r���r���r���r���)r���r����r���)r���r���r����r����)r���)r���)r���)N)r���r���)B�__doc__Z __copyright__�__version__�collectionsr*����rer0���r����compiler���r����ASCIIr6���rC���rM���r\���rb���r|���r~���ro���rn���r����r����r����r����r����r����r����r����r����r����r����r����r1���r����� namedtupler����r����r����r^���r����r_���r���r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����rV����__name__�argvr����r�����print�exitr���r���r���r����<module>���s����Y ����� � G ��� 1�� 3 #4 $�P�� ���� h L