403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.1
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/source/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/test/test_importlib/source/__pycache__/test_source_encoding.cpython-312.pyc
�

���g����ddlmZejd�ZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZejdej�ZGd�d�ZGd�de�Zej"ee�	�\ZZGd
�de�Zej"ee�	�\ZZGd�d
�ZGd�de�Zej"ee�	�\ZZGd�de�Zej"ee�	�\ZZedk(re
j>�yy)�)�utilzimportlib.machineryNz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)c�v�eZdZdZdZdZdj
ee�ZdZd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zy)�EncodingTesta�PEP 3120 makes UTF-8 the default encoding for source code
    [default encoding].

    PEP 263 specifies how that can change on a per-file basis. Either the first
    or second line can contain the encoding line [encoding first line]
    [encoding second line]. If the file has the BOM marker it is considered UTF-8
    implicitly [BOM]. If any encoding is specified it must be UTF-8, else it is
    an error [BOM and utf-8][BOM conflict].

    �ü�Éz{0} = '{1}'
�_tempc�r�tj|j�5}t||jd�5}|j	|�ddd�|j
j
|j||j�}|j|�cddd�S#1swY�VxYw#1swYyxYw)N�wb)r�create_modules�module_name�open�write�	machinery�SourceFileLoader�load)�self�source�mapping�file�loaders     �DC:\Python312\\Lib\test\test_importlib\source\test_source_encoding.py�run_testzEncodingTest.run_test%s���
�
 �
 ��!1�!1�
2�g��g�d�.�.�/��6�$��
�
�6�"�7��^�^�4�4�T�5E�5E�29�$�:J�:J�2K�M�F��9�9�V�$�3�
2�6�6��3�
2�s#�B-�B!�AB-�!B*	�&B-�-B6c���dj|�}tj|�sJ�|jd�g}|j	|j
j|��dj
|�S)Nz# coding={0}�utf-8�
)�format�	CODING_RE�match�encode�append�source_line�join)r�encoding�
encoding_line�source_liness    r�
create_sourcezEncodingTest.create_source-se��&�-�-�h�7�
����}�-�-�-�%�,�,�W�5�6�����D�,�,�3�3�H�=�>��z�z�,�'�'�c��d}tj|�sJ�dj|�jd�}|j	|�y)Nz# coding=koi8-rz	{0}
a=42
zkoi8-r)rrrrr)rr$rs   r�test_non_obvious_encodingz&EncodingTest.test_non_obvious_encoding4sB��*�
����}�-�-�-��%�%�m�4�;�;�H�E���
�
�f�r'c�X�|j|jjd��y�Nr)rr!r�rs r�test_default_encodingz"EncodingTest.test_default_encoding=s���
�
�d�&�&�-�-�g�6�7r'c�L�d}|j|�}|j|�y)N�Latin-1�r&r)rr#rs   r�test_encoding_on_first_linez(EncodingTest.test_encoding_on_first_lineAs#�����#�#�H�-���
�
�f�r'c�N�d|jd�z}|j|�y)Ns#/usr/bin/python
r/r0�rrs  r�test_encoding_on_second_linez)EncodingTest.test_encoding_on_second_lineGs#��&��);�);�I�)F�F���
�
�f�r'c�z�|jtj|jj	d�z�yr+)r�codecs�BOM_UTF8r!rr,s r�test_bomzEncodingTest.test_bomLs(���
�
�f�o�o��(8�(8�(?�(?��(H�H�Ir'c�j�tj|jd�z}|j|�yr+)r6r7r&rr3s  r�test_bom_and_utf_8zEncodingTest.test_bom_and_utf_8Ps'�����4�#5�#5�g�#>�>���
�
�f�r'c��tj|jd�z}|jt�5|j|�ddd�y#1swYyxYw)Nzlatin-1)r6r7r&�assertRaises�SyntaxErrorrr3s  r�test_bom_conflictzEncodingTest.test_bom_conflictUsA�����4�#5�#5�i�#@�@��
�
�
�{�
+��M�M�&�!�,�
+�
+�s�A�AN)�__name__�
__module__�__qualname__�__doc__�variable�	characterrr!rrr&r)r-r1r4r8r:r>�r'rrrsX��	��H��I�!�(�(��9�=�K��K�%�(��8���
J��
"r'rc��eZdZd�Zy)�EncodingTestPEP451c���tj|j�}tjj|j|�|_|j|�|S�N)�types�
ModuleTyper�	importlibr�spec_from_loader�__spec__�exec_module)rr�modules   rrzEncodingTestPEP451.load]sI���!�!�$�"2�"2�3��#�.�.�9�9�$�:J�:J�F�S������6�"��
r'N�r?r@rArrEr'rrGrG[���r'rG)rc��eZdZd�Zy)�EncodingTestPEP302c��tj�5tjdt�|j	|j
�cddd�S#1swYyxYw�N�ignore)�warnings�catch_warnings�simplefilter�DeprecationWarning�load_moduler)rrs  rrzEncodingTestPEP302.loadks?��
�
$�
$�
&��!�!�(�,>�?��%�%�d�&6�&6�7�'�
&�
&�s�5A�ANrQrEr'rrTrTis��8r'rTc�(�eZdZdZd�Zd�Zd�Zd�Zy)�LineEndingTestzjSource written with the three types of line endings (\n, \r\n, \r)
    need to be readable [cr][crlf][lf].c�R�d}gd�}|j|�}tj|�5}t||d�5}|j	|�ddd�|j
j
|||�}|j||�cddd�S#1swY�CxYw#1swYyxYw)Nr)sa = 42sb = -13r'r
)r"rrr
rrrr)r�line_endingrr%rrrrs        rrzLineEndingTest.run_test{s�����3���!�!�,�/��
�
 �
 ��
-���g�k�*�D�1�T��
�
�6�"�2��^�^�4�4�[�5<�[�5I�K�F��9�9�V�[�1�.�
-�1�1��.�
-�s"�B�B�8B�B	�B�B&c�&�|jd�y)N�
�rr,s r�test_crzLineEndingTest.test_cr�����
�
�e�r'c�&�|jd�y)Ns
rcr,s r�	test_crlfzLineEndingTest.test_crlf�s���
�
�g�r'c�&�|jd�y)Nrrcr,s r�test_lfzLineEndingTest.test_lf�rer'N)r?r@rArBrrdrgrirEr'rr^r^vs��+�	2���r'r^c��eZdZd�Zy)�LineEndingTestPEP451c��tj|�}tjj	||�|_|j
|�|SrI)rJrKrLrrMrNrO)rrrrPs    rrzLineEndingTestPEP451.load�s=���!�!�+�.��#�.�.�9�9�+�v�N������6�"��
r'NrQrEr'rrkrk�rRr'rkc��eZdZd�Zy)�LineEndingTestPEP302c��tj�5tjdt�|j	|�cddd�S#1swYyxYwrV)rXrYrZr[r\)rrrs   rrzLineEndingTestPEP302.load�s9��
�
$�
$�
&��!�!�(�,>�?��%�%�k�2�'�
&�
&�s�+A
�
ANrQrEr'rrnrn�s��3r'rn�__main__) �test.test_importlibr�import_importlibrr6�importlib.utilrL�rerJ�unicodedata�unittestrX�compile�ASCIIrrrG�	test_both�Frozen_EncodingTestPEP451�Source_EncodingTestPEP451rT�Frozen_EncodingTestPEP302�Source_EncodingTestPEP302r^rk�Frozen_LineEndingTestPEP451�Source_LineEndingTestPEP451rn�Frozen_LineEndingTestPEP302�Source_LineEndingTestPEP302r?�mainrEr'r�<module>r�s$��$�!�D�!�!�"7�8�	�
��	�����
�B�J�J�@�"�(�(�K�	�E"�E"�P����T�^�^�&�)�<����8��8��T�^�^�&�)�<������:�>���T�^�^�(�I�>����3�>�3��T�^�^�(�I�>�����z���H�M�M�O�r'

Youez - 2016 - github.com/yon3zu
LinuXploit