403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/test/test_importlib/resources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/test/test_importlib/resources/__pycache__/test_files.cpython-312.opt-1.pyc
�

���g���ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddlm
Z
ddlmZddl
mZddl
mZddl
mZddlmZmZe	j(d	��ZGd
�d�ZGd�d
eej.�ZGd�deej2ej.�ZGd�deej.�ZGd�d�ZGd�deej.�ZGd�deej.�Zedk(rej@�yy)�N)�	resources)�Traversable�)�data01)�util)�_path)�	os_helper�
import_helperc#�K�tjd��5}tjdt��|��ddd�y#1swYyxYw�w)NT)�record�default)�category)�warnings�catch_warnings�simplefilter�DeprecationWarning)�ctxs �=C:\Python312\\Lib\test\test_importlib\resources\test_files.py�suppress_known_deprecationrs7����	�	 �	 ��	-�����i�2D�E��	�
.�	-�	-�s�A� A�	A�A�Ac�^�eZdZd�Zd�Zejeed�d�d��Z	d�Z
y)�
FilesTestsc��tj|j�}|jd�j	�}y)N�
utf-8.file)r�files�data�joinpath�
read_bytes��selfr�actuals   r�test_read_byteszFilesTests.test_read_bytess+������	�	�*������-�8�8�:��c��tj|j�}|jd�j	d��}y)Nr�utf-8��encoding)rrrr�	read_textrs   r�test_read_textzFilesTests.test_read_text!s0������	�	�*������-�7�7��7�I�r"�runtime_checkablez4Only suitable when typing supports runtime_checkablec��y�N��rs r�test_traversablezFilesTests.test_traversable&s�r"c��t�5tj|j��ddd�y#1swYyxYw)zx
        Files used to take a 'package' parameter. Make sure anyone
        passing by name is still supported.
        )�packageN)rrrrr-s r�test_old_parameterzFilesTests.test_old_parameter-s&��
(�
)��O�O�D�I�I�.�*�
)�
)�s�!5�>N)�__name__�
__module__�__qualname__r!r(�unittest�
skipUnless�hasattr�typingr.r1r,r"rrrsB��2�
1�
�X�����+�,�>��C�	�C�/r"rc��eZdZd�Zy)�
OpenDiskTestsc��t|_yr+)rrr-s r�setUpzOpenDiskTests.setUp7s	����	r"N�r2r3r4r<r,r"rr:r:6s��r"r:c��eZdZy)�OpenZipTestsN)r2r3r4r,r"rr?r?;s��r"r?c��eZdZd�Zy)�OpenNamespaceTestsc��ddlm}||_y)Nr)�namespacedata01)�rCr)rrCs  rr<zOpenNamespaceTests.setUp@s��%�#��	r"Nr=r,r"rrArA?s��$r"rAc��eZdZd�Zy)�SiteDirc��tj�|_|j|jj�|jjt
j��|_|jjtj|j��|jjtj��yr+)�
contextlib�	ExitStack�fixtures�
addCleanup�close�
enter_contextr	�temp_dir�site_dirr
�
DirsOnSysPath�isolated_modulesr-s rr<z
SiteDir.setUpGs���"�,�,�.��
�����
�
�+�+�,��
�
�3�3�I�4F�4F�4H�I��
��
�
�#�#�M�$?�$?��
�
�$N�O��
�
�#�#�M�$B�$B�$D�Er"Nr=r,r"rrFrFFs��Fr"rFc��eZdZd�Zy)�ModulesFilesTestsc��ddd�}tj||j�ddl}t	j
|�j
d�jd��}y)	zK
        A module can have resources found adjacent to the module.
        rD�resources are the best)zmod.py�res.txtrNrVr$r%)r�buildrO�modrrrr')r�specrXr s    r�test_module_resourcesz'ModulesFilesTests.test_module_resourcesPsO��
�/�
��	���D�$�-�-�(������%�.�.�y�9�C�C�W�C�U�r"N)r2r3r4rZr,r"rrSrSOs��)r"rSc�$�eZdZd�Zd�Zd�Zd�Zy)�ImplicitContextFilesTestsc�x�dtjd�dd�i}tj||j�y)zW
        Without any parameter, files() will infer the location as the caller.
        �somepkgz�
                    import importlib.resources as res
                    val = res.files().joinpath('res.txt').read_text(encoding='utf-8')
                    rU��__init__.pyrVN)�textwrap�dedentrrWrO)rrYs  r�test_implicit_filesz-ImplicitContextFilesTests.test_implicit_files`s=��

�'���� �4��

��	���D�$�-�-�(r"c���ddl��fd�}tjd�}d||dd�i}|jj	tj��}tj||�tjj|jd�}|||�|jj	tj|��y)	z=
        Special test for gh-121735 for Python 3.12.
        rNc�D���	j|d�5}tj|�D]_\}}}|D]T}tjj	||�}tjj||�}|j
||��V�a	ddd�y#1swYyxYw)N�w)�ZipFile�os�walk�path�join�relpath�write)
�
source_dir�zip_filename�zipf�root�_r�file�	file_path�arcname�zipfiles
         �r�create_zip_from_directoryz^ImplicitContextFilesTests.test_implicit_files_zip_submodule.<locals>.create_zip_from_directoryxsx�������s�3�t�&(�g�g�j�&9�N�D�!�U� %��$&�G�G�L�L��t�$<�	�"$�'�'�/�/�)�Z�"H���
�
�9�g�6�	!&�':�4�3�3�s�A8B�Bz�
            import importlib.resources as res
            val = res.files().joinpath('res.txt').read_text(encoding='utf-8')
            r^rU)r`z	submod.pyrVz
thepkg.zip)rvrarbrJrMr	rNrrWrhrjrkrOr
rP)rrw�set_valrY�	build_dir�zip_filervs      @r�!test_implicit_files_zip_submodulez;ImplicitContextFilesTests.test_implicit_files_zip_submodulers����	�	7��/�/�
�
��
�&�$�3��
���M�M�/�/�	�0B�0B�0D�E�	�
���D�)�$��7�7�<�<��
�
�|�<��!�)�X�6��
�
�#�#�M�$?�$?��$I�Jr"c��|jjtj��}t	j
|d�}t	j
tj�j}|jd�D]G}|j|j|��jd�}tj||��I|jjtj |��y)z�
        Make a compiled-only copy of the importlib resources package.

        Currently only code is copied, as importlib resources doesn't itself
        have any resources.
        �c_resourcesz**/*.pyz.pycN)rJrMr	rN�pathlib�Pathr�__file__�parent�globr�relative_to�with_suffix�
py_compile�compiler
rP)r�bin_siter}�sources�source_path�c_paths      r�_compile_importlibz,ImplicitContextFilesTests._compile_importlib�s����=�=�.�.�y�/A�/A�/C�D���l�l�8�]�;���,�,�y�1�1�2�9�9��"�<�<�	�2�K� �)�)�+�*A�*A�'�*J�K�W�W�X^�_�F����{�F�3�3�	
�
�
�#�#�M�$?�$?��$I�Jr"c��tjdtj�d��}d|j	tjd�dd�i}tj||j�|j�y)zk
        Caller detection works for compiled-only resources module.

        python/cpython#123085
        z
            import zb as res
            val = res.files().joinpath('res.txt').read_text(encoding='utf-8')
            �	frozenpkgr}rUr_N)	rarbrr2�replacerrWrOr�)rrxrYs   r�+test_implicit_files_with_compiled_importlibzEImplicitContextFilesTests.test_implicit_files_with_compiled_importlib�su���/�/���&�&�'�(
�
�
��
�&���y�/A�/A�=�Q�3��
��	���D�$�-�-�(����!r"N)r2r3r4rcr{r�r�r,r"rr\r\_s��R�$!Y�FK� Tr"r\�__main__)!r8rhr~r��shutilrar5r�	importlibrHr�importlib.resources.abcrrDrrr�test.supportr	r
�contextmanagerrr�TestCaser:�ZipSetupr?rArFrSr\r2�mainr,r"r�<module>r�s���
�	���
�������/����1�������/�/�6�J�� 1� 1��
	�:�t�}�}�h�.?�.?�	�$��X�%6�%6�$�F�F�
)���!2�!2�
)� ZT���):�):�ZT�z�z���H�M�M�O�r"

Youez - 2016 - github.com/yon3zu
LinuXploit