Your IP : 18.219.158.84


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/zipimport.cpython-310.opt-1.pyc

o

6��f�x�@sPdZddlZddlmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddgZ
ejZejdd�ZGdd�de�ZiZee
�ZdZd	Zd
ZGdd�dej�Zedd
d
feddd
fddfZdd�Zdd�Zdd�Zdd�ZdZ da!dd�Z"dd�Z#dd �Z$d!d"�Z%ee%j&�Z'd#d$�Z(d%d&�Z)d'd(�Z*d)d*�Z+d+d,�Z,d-d.�Z-dS)/aPzipimport provides support for importing Python modules from Zip archives.

This module exports three objects:
- zipimporter: a class; its constructor takes a path to a Zip archive.
- ZipImportError: exception raised by zipimporter objects. It's a
  subclass of ImportError, so it can be caught as ImportError, too.
- _zip_directory_cache: a dict, mapping archive paths to zip directory
  info dicts, as used in zipimporter._files.

It is usually not needed to use the zipimport module explicitly; it is
used by the builtin import mechanism for sys.path items that are paths
to Zip archives.
�N)�_unpack_uint16�_unpack_uint32�ZipImportError�zipimporter�c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�0/opt/alt/python310/lib64/python3.10/zipimport.pyr"s�sPKi��c@s~eZdZdZdd�Zddd�Zddd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)ra�zipimporter(archivepath) -> zipimporter object

    Create a new zipimporter instance. 'archivepath' must be a path to
    a zipfile, or to a specific path inside a zipfile. For example, it can be
    '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a
    valid directory inside the archive.

    'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip
    archive.

    The 'archive' attribute of zipimporter objects contains the name of the
    zipfile targeted.
    c	Cs$t|t�sddl}|�|�}|std|d��tr|�tt�}g}	zt�	|�}Wn#t
tfyKt�|�\}}||krBtd|d��|}|�
|�Ynw|jd@dkrYtd|d��nq!zt|}Wntyrt|�}|t|<Ynw||_||_tj|ddd��|_|jr�|jt7_dSdS)	Nrzarchive path is empty��pathTznot a Zip filei�i����)�
isinstance�str�os�fsdecoder�alt_path_sep�replace�path_sep�_bootstrap_external�
_path_stat�OSError�
ValueError�_path_split�append�st_mode�_zip_directory_cache�KeyError�_read_directory�_files�archive�
_path_join�prefix)�selfrrr$�st�dirname�basename�filesr
r
r�__init__@sD

�
���zzipimporter.__init__NcCsZt�dt�t||�}|dur|gfSt||�}t||�r)d|j�t�|��gfSdgfS)a/find_loader(fullname, path=None) -> self, str or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, a string containing the
        full path name if it's possibly a portion of a namespace package,
        or None otherwise. The optional 'path' argument is ignored -- it's
        there for compatibility with the importer protocol.

        Deprecated since Python 3.10. Use find_spec() instead.
        zfzipimporter.find_loader() is deprecated and slated for removal in Python 3.12; use find_spec() insteadN)�	_warnings�warn�DeprecationWarning�_get_module_info�_get_module_path�_is_dirr"r)r%�fullnamer�mi�modpathr
r
r�find_loaderns�


zzipimporter.find_loadercCst�dt�|�||�dS)a�find_module(fullname, path=None) -> self or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, or None if it wasn't.
        The optional 'path' argument is ignored -- it's there for compatibility
        with the importer protocol.

        Deprecated since Python 3.10. Use find_spec() instead.
        zfzipimporter.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() insteadr)r+r,r-r4)r%r1rr
r
r�find_module�s�zzipimporter.find_modulecCslt||�}|durtj|||d�St||�}t||�r4|j�t�|��}tj|ddd�}|j�	|�|SdS)zkCreate a ModuleSpec for the specified module.

        Returns None if the module cannot be found.
        N)�
is_packageT)�name�loaderr6)
r.�
_bootstrap�spec_from_loaderr/r0r"r�
ModuleSpec�submodule_search_locationsr)r%r1�target�module_infor3r�specr
r
r�	find_spec�s


�zzipimporter.find_speccCst||�\}}}|S)z�get_code(fullname) -> code object.

        Return the code object for the specified module. Raise ZipImportError
        if the module couldn't be imported.
        ��_get_module_code�r%r1�code�	ispackager3r
r
r�get_code�szzipimporter.get_codecCsptr|�tt�}|}|�|jt�r|t|jt�d�}z|j|}Wn
ty1tdd|��wt	|j|�S)z�get_data(pathname) -> string with file data.

        Return the data associated with 'pathname'. Raise OSError if
        the file wasn't found.
        Nr�)
rrr�
startswithr"�lenr!rr�	_get_data)r%�pathname�key�	toc_entryr
r
r�get_data�s�zzipimporter.get_datacCst||�\}}}|S)z�get_filename(fullname) -> filename string.

        Return the filename for the specified module or raise ZipImportError
        if it couldn't be imported.
        rArCr
r
r�get_filename�szzipimporter.get_filenamecCs~t||�}|durtd|��|d��t||�}|r t�|d�}n|�d�}z|j|}Wn
ty6YdSwt|j|��	�S)z�get_source(fullname) -> source string.

        Return the source code for the specified module. Raise ZipImportError
        if the module couldn't be found, return None if the archive does
        contain the module, but has no source for it.
        N�can't find module �r7�__init__.py�.py)
r.rr/rr#r!rrJr"�decode)r%r1r2r�fullpathrMr
r
r�
get_source�s


�zzipimporter.get_sourcecCs(t||�}|durtd|��|d��|S)z�is_package(fullname) -> bool.

        Return True if the module specified by fullname is a package.
        Raise ZipImportError if the module couldn't be found.
        NrPrQ)r.r)r%r1r2r
r
rr6s
zzipimporter.is_packagec	Cs�d}t�|t�t||�\}}}tj�|�}|dust|t�s(t|�}|tj|<||_	z*|r>t
||�}t�|j
|�}|g|_t|d�sFt|_t�|j||�t||j�Wntj|=�ztj|}Wntyttd|�d���wt�d||�|S)a@load_module(fullname) -> module.

        Load the module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the imported
        module, or raises ZipImportError if it could not be imported.

        Deprecated since Python 3.10. Use exec_module() instead.
        zrzipimport.zipimporter.load_module() is deprecated and slated for removal in Python 3.12; use exec_module() insteadN�__builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r+r,r-rB�sys�modules�getr�_module_type�
__loader__r/rr#r"�__path__�hasattrrW�_fix_up_module�__dict__�execr�ImportErrorr9�_verbose_message)	r%r1�msgrDrEr3�modrrUr
r
r�load_modules6	


�zzipimporter.load_modulecCs@z
|�|�s	WdSWn
tyYdSwddlm}|||�S)z�Return the ResourceReader for a package in a zip file.

        If 'fullname' is a package within the zip file, return the
        'ResourceReader' object for the package.  Otherwise return None.
        Nr)�	ZipReader)r6r�importlib.readersrg)r%r1rgr
r
r�get_resource_reader;s
��
zzipimporter.get_resource_readercCsHzt|j�|_|jt|j<WdSty#t�|jd�i|_YdSw)z)Reload the file data of the archive path.N)r r"r!rr�pop�r%r
r
r�invalidate_cachesJs�zzipimporter.invalidate_cachescCsd|j�t�|j�d�S)Nz<zipimporter object "z">)r"rr$rkr
r
r�__repr__Tszzipimporter.__repr__�N)rrr	�__doc__r*r4r5r@rFrNrOrVr6rfrirlrmr
r
r
rr.s
.
%


+
z__init__.pycTrRF)z.pycTF)rSFFcCs|j|�d�dS)N�.�)r$�
rpartition)r%r1r
r
rr/fsr/cCs|t}||jvSrn)rr!)r%r�dirpathr
r
rr0js
r0cCs8t||�}tD]\}}}||}||jvr|SqdSrn)r/�_zip_searchorderr!)r%r1r�suffix�
isbytecoderErUr
r
rr.ss

�r.c
Cszt�|�}Wntytd|��|d��w|��T|��}�z@z|�td�|��}|�t�}WntyDtd|��|d��wt|�tkrTtd|��|d��|dd�t	kr�z|�dd�|��}Wntyxtd|��|d��wt
|ttd�}z|�|�|��}Wnty�td|��|d��w|�t	�}|dkr�td|��|d��|||t�}t|�tkr�td|��|d��|t|�|}t
|d	d
��}	t
|d
d��}
||	kr�td|��|d��||
kr�td
|��|d��||	8}||
}|dk�rtd|��|d��i}d}
z|�|�Wnt�y+td|��|d��w	|�d�}t|�dk�r=td��|dd�dk�rH�nt|�dk�rStd��t|dd��}t|dd	��}t|d	d��}t|dd
��}t
|d
d��}t
|dd��}t
|dd��}t|dd��}t|dd��}t|dd��}t
|dd��}|||}	||
k�r�td|��|d��||7}z|�|�}Wnt�y�td|��|d��wt|�|k�r�td|��|d��zt|�|	|��|	|k�rtd|��|d��Wnt�ytd|��|d��w|d@�r!|��}nz|�d�}Wnt�y:|�d��t�}Ynw|�d t�}t�||�}||||||||f}|||<|
d!7}
�q-W|�|�n|�|�wWd�n	1�sswYt�d"|
|�|S)#Nzcan't open Zip file: r
rq�can't read Zip file: �rznot a Zip file: zcorrupt Zip file: ���zbad central directory size: zbad central directory offset: z&bad central directory size or offset: T�.�EOF read where not expectedsPK��
����� �"�*zbad local header offset: i�ascii�latin1�/rz!zipimport: found {} names in {!r})�_io�	open_coderr�tell�seek�END_CENTRAL_DIR_SIZE�readrI�STRING_END_ARCHIVE�max�MAX_COMMENT_LEN�rfindr�EOFErrorrrT�UnicodeDecodeError�	translate�cp437_tablerrrr#r9rc)r"�fp�start_offset�header_position�buffer�	file_size�max_comment_start�data�pos�header_size�
header_offset�
arc_offsetr)�count�flags�compress�time�date�crc�	data_size�	name_size�
extra_size�comment_size�file_offsetr7r�tr
r
rr �s���
����

��

�
�
�

���

��2�tr u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ cCsjtrt�d�td��dazzddlm}Wnty&t�d�td��wWdandawt�d�|S)Nzzipimport: zlib UNAVAILABLE�)can't decompress data; zlib not availableTr��
decompressFzzipimport: zlib available)�_importing_zlibr9rcr�zlibr��	Exceptionr�r
r
r�_get_decompress_func7s

��
r�c	Csx|\}}}}}}}}	|dkrtd��t�|���}
z|
�|�Wnty/td|��|d��w|
�d�}t|�dkr?td��|dd�dkrPtd	|��|d��t|d
d��}t|dd��}
d||
}||7}z|
�|�Wnty�td|��|d��w|
�|�}t|�|kr�td��Wd�n1s�wY|dkr�|Szt	�}Wnt
y�td
��w||d�S)Nrznegative data sizerwr
r�r}rxsPKzbad local file header: �r�zzipimport: can't read datar�i�)rr�r�r�rr�rIr�rr�r�)r"rM�datapathr�r�r�r�r�r�r�r�r�r�r�r��raw_datar�r
r
rrJLsH�
�
��
�
rJcCst||�dkS)Nr)�abs)�t1�t2r
r
r�	_eq_mtimezsr�cCs�||d�}t�|||�}|d@dk}|r?|d@dk}tjdkr>|s&tjdkr>t||�}	|	dur>t�tj|	�}
t�||
||�n(t||�\}}|rgt	t
|dd��|�r]t
|dd	��|krgt�d
|���dSt
�|d	d��}
t|
t�s}td|�d���|
S)
N)r7rrrrq�never�alwaysr~ryrzzbytecode is stale for zcompiled module z is not a code object)r�
_classify_pyc�_imp�check_hash_based_pycs�_get_pyc_source�source_hash�_RAW_MAGIC_NUMBER�_validate_hash_pyc�_get_mtime_and_size_of_sourcer�rr9rc�marshal�loadsr�
_code_type�	TypeError)r%rKrUr1r��exc_detailsr��
hash_based�check_source�source_bytesr��source_mtime�source_sizerDr
r
r�_unmarshal_code�sD�
�

�����
r�cCs|�dd�}|�dd�}|S)Ns
�
�
)r)�sourcer
r
r�_normalize_line_endings�sr�cCst|�}t||ddd�S)NraT)�dont_inherit)r��compile)rKr�r
r
r�_compile_source�sr�cCsDt�|d?d|d?d@|d@|d?|d?d@|d@dd	d	d	f	�S)
N�	i������?rqr)r��mktime)�dr�r
r
r�_parse_dostime�s



�r�c
CsZz|dd�}|j|}|d}|d}|d}t||�|fWStttfy,YdSw)Nrr���)rr)r!r�r�
IndexErrorr�)r%rrMr�r��uncompressed_sizer
r
rr��s
�r�cCs<|dd�}z|j|}Wn
tyYdSwt|j|�S)Nr)r!rrJr")r%rrMr
r
rr��s�r�cCst||�}d}tD]f\}}}||}tjd|jt|dd�z|j|}Wn	ty-Yq	w|d}	t|j|�}
d}|r[z
t	||	|||
�}Wnt
yZ}z|}WYd}~n
d}~wwt|	|
�}|dureq	|d}	|||	fS|r~d|��}
t|
|d�|�td|��|d��)Nz
trying {}{}{}rq)�	verbosityrzmodule load failed: rQrP)
r/rtr9rcr"rr!rrJr�rbr�r)r%r1r�import_errorrurvrErUrMr3r�rD�excrdr
r
rrB�s:
���

rB).ro�_frozen_importlib_externalrrr�_frozen_importlibr9r�r�r�rXr�r+�__all__r�path_separatorsrrbrr�typer[r�r�r��
_LoaderBasicsrrtr/r0r.r r�r�r�rJr�r��__code__r�r�r�r�r�r�rBr
r
r
r�<module>s\2�		�.
(


?>