403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.26
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:/Python313/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/__pycache__/test_readline.cpython-313.pyc
�

��i;B���SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJ	r	 SSK
Jr SSKJ
r
JrJr SSKJr SSKJr SSKJr \"S	5r\"\S
5(aS\R0;rO\R4S:HrS
r\R8"\"\S5S5"SS\R:55r"SS\R:5r\ S:Xa\RB"5 gg)z:
Very minimal unittests for parts of the readline module.
�N)�verbose)�
import_module)�unlink�temp_dir�TESTFN)�run_pty)�assert_python_ok)�requires_working_threading�readline�_READLINE_LIBRARY_VERSIONzEditLine wrapper�editlinec�B�[(a�[[S5(a:[S[RS35 [S[R
S35 [[S5(a[S[R<35 [S[35 gg)N�_READLINE_VERSIONzreadline version: z#xzreadline runtime version: rzreadline library version: zuse libedit emulation? )r�hasattrr�printr�_READLINE_RUNTIME_VERSIONr�is_editline���'C:\Python313\\Lib\test\test_readline.py�setUpModulers����w��8�0�1�1��&�x�'A�'A�"�&E�F�G��.�x�/Q�/Q�RT�.U�V�W��8�8�9�9��.�x�/Q�/Q�.T�U�V�
�'��}�5�6�r�
clear_historyzXThe history update test cannot be run because the clear_history method is not available.c�j�\rSrSrSrSr\R"\"\	S5S5S5r
SrSrS	r
g
)�TestHistoryManipulation�'z�
These tests were added to check that the libedit emulation on OSX and the
"real" readline have the same interface for history manipulation. That's
why the tests cover only a small subset of the interface.
c��[R5 [RS5 [RS5 UR[R	S5S5 UR[R	S5S5 UR[R	S5S5 [RSS5 UR[R	S5S5 UR[R	S5S5 UR[R	S5S5 UR[R
5S5 [RS5 UR[R	S5S5 UR[R	S5S5 UR[R
5S5 g)N�
first line�second liner��z
replaced line)rr�add_history�assertEqual�get_history_item�replace_history_item�get_current_history_length�remove_history_item��selfs r�testHistoryUpdates�*TestHistoryManipulation.testHistoryUpdates1sR����� ����\�*����]�+�����2�2�1�5�t�<�����2�2�1�5�|�D�����2�2�1�5�}�E��%�%�a��9�����2�2�1�5�t�<�����2�2�1�5��G�����2�2�1�5�}�E�����<�<�>��B��$�$�Q�'�����2�2�1�5�t�<�����2�2�1�5�}�E�����<�<�>��Br�append_history_filezappend_history not availablec�4�[R"SS9nUR5 URnUR	[
U5 [R5 [RS5 [RS5 [RU5 [R5 UR[R5S5 [RU5 UR[R5S5 UR[RS5S5 UR[RS5S5 [RSU5 [R5 [RU5 UR[R5S5 UR[RS5S5 UR[RS5S5 UR[RS5S5 [R
"U5 [RSU5 [R
"U5 [RU5 UR#[$5 [RS	U5 SSS5 UR#[$5 [RS
U5 SSS5 g![ a N�f=f!,(df   NS=f!,(df   g=f)NF)�deleterrrr r�i���i�)�tempfile�NamedTemporaryFile�close�name�
addCleanuprrrr!�write_history_filer"r%�read_history_filer#r+�os�FileNotFoundError�assertRaises�
ValueError)r(�hfile�	hfilenames   r�test_write_read_append�.TestHistoryManipulation.test_write_read_appendHs8���+�+�5�9��
���
��J�J�	�����	�*�	��� ����\�*����]�+��#�#�I�.���� �����<�<�>��B��"�"�9�-�����<�<�>��B�����2�2�1�5�|�D�����2�2�1�5�}�E�	�$�$�Q�	�2���� ��"�"�9�-�����<�<�>��B�����2�2�1�5�|�D�����2�2�1�5�}�E�����2�2�1�5�}�E�	�	�	�)��	!��(�(��I�6�
�I�I�i� �	�#�#�I�.��
�
�z�
*��(�(��i�8�+��
�
�z�
*��(�(��i�@�+�
*��!!�	��	��+�
*��+�
*�s*�>K(�K8�L	�(
K5�4K5�8
L�	
Lc��[R5 [RS5 [RS5 [R
SS5 [R[5 UR[R[5 [R5 [R[5 [(a[RS5 UR[RS5S5 UR[RS5S5 g![a(nUR	S[U5-5 SnAGN-SnAff=f)Nu	entrée 1� Locale cannot encode test data: u	entrée 2ru
entrée 22�dummyr )rrr!�UnicodeEncodeError�skipTest�formatr$r4rr3r6�remover5rr"r#)r(�errs  r�test_nonascii_history�-TestHistoryManipulation.test_nonascii_history~s������ �	L�� � ��-�	���[�)��%�%�a��6��#�#�F�+�����	�	�6�*���� ��"�"�6�*��;�
� � ��)�����2�2�1�5�{�C�����2�2�1�5�|�D��"�	L��M�M�<�v�c�{�J�K�K��	L�s�D+�+
E�5E�Ec��[R5nUR[RU5 [R	5 [RS5 [RS5 [RS5 [RS5 UR
[R5S5 [R[5 UR[R[5 [R	5 UR
[R5S5 UR
[R5S5 [R[5 UR
[RS5S5 UR
[RS5S5 UR
[RS5S5 UR[R5S5 g)	Nrr�
third liner rrr.)r r.)r�get_history_lengthr3�set_history_lengthrr!r"r4rr6rDr%r5r#�assertIn�r(�previous_lengths  r�test_write_read_limited_history�7TestHistoryManipulation.test_write_read_limited_history�sW��"�5�5�7������3�3�_�E���� ����\�*����]�+����\�*��#�#�A�&�����4�4�6��:��#�#�F�+�����	�	�6�*���� �����<�<�>��B�����4�4�6��:��"�"�6�*�����2�2�1�5�}�E�����2�2�1�5�|�D�����2�2�1�5�t�<�	
�
�
�h�9�9�;�V�DrrN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r)�unittest�
skipUnlessrrr<rFrO�__static_attributes__rrrrr'sH���C�.�����+@�A�7�9�2A�9�2A�hE�&Errc�6�\rSrSr\R
"\RS:=(a \(+S5S5r	Sr
SrSrSr
S	rS
r\R
"\RS:S5\R
"\S
5S55r\"5S5rSrSrg)�TestReadline�iz%not supported in this library versionc�D�[SSSS9upnURUS5 g)Nz-czimport readlinezxterm-256color)�TERMr)r	r")r(�rc�stdout�stderrs    r�	test_init�TestReadline.test_init�s,��.�d�4E�3C�E���F������%rc�D�UR[RS5 g)N)rr
)rLr�backendr's r�test_backend�TestReadline.test_backend�s���
�
�h�&�&�(@�Arzvimport readline
readline.set_auto_history({})
input()
print("History length:", readline.get_current_history_length())
c�p�[URRS55nURSU5 g)NTsHistory length: 1�r�auto_history_scriptrCrL�r(�outputs  r�test_auto_history_enabled�&TestReadline.test_auto_history_enabled�s.����1�1�8�8��>�?��	
�
�
�*�F�3rc�p�[URRS55nURSU5 g)NFsHistory length: 0rhrjs  r�test_auto_history_disabled�'TestReadline.test_auto_history_disabled�s.����1�1�8�8��?�@��	
�
�
�*�F�3rc�h�[R"S5n[USS9nURSU5 g)Na�
            import readline
            def complete(text, state):
                if state == 0 and text == "$":
                    return "$complete"
                return None
            if readline.backend == "editline":
                readline.parse_and_bind(r'bind "\t" rl_complete')
            else:
                readline.parse_and_bind(r'"\t": complete')
            readline.set_completer_delims(" \t\n")
            readline.set_completer(complete)
            print(input())
        s$	
��inputs	$complete��textwrap�dedentrrL�r(�scriptrks   r�test_set_complete_delims�%TestReadline.test_set_complete_delims�s1�����
"�

����x�0���
�
�l�F�+rc���[R"[RS5nUS;aURSU<35 [R
R(aP[R"5n[R"U5RnUS:waURSU<35 [RS5 SnSnUS	[S
5--
nUS-
nUS-
nUS
-
n[!XE5nUR#SU5 UR#SU5 [R$S:Xd[&(dUR#SU5 [&(d9[)[S5(a$UR#SU5 UR#SU5 SnUR#SU-S-U5 UR#SU-U5 g![a(nURS[U5-5 SnAGN%SnAff=f)N)�C�POSIXzthe LC_CTYPE locale is zutf-8zthe LC_CTYPE encoding is uëïr?aimport readline

is_editline = readline.backend == "editline"
inserted = "[\xEFnserted]"
macro = "|t\xEB[after]"
set_pre_input_hook = getattr(readline, "set_pre_input_hook", None)
if is_editline or not set_pre_input_hook:
    # The insert_line() call via pre_input_hook() does nothing with Editline,
    # so include the extra text that would have been inserted here
    macro = inserted + macro

if is_editline:
    readline.parse_and_bind(r'bind ^B ed-prev-char')
    readline.parse_and_bind(r'bind "\t" rl_complete')
    readline.parse_and_bind(r'bind -s ^A "{}"'.format(macro))
else:
    readline.parse_and_bind(r'Control-b: backward-char')
    readline.parse_and_bind(r'"\t": complete')
    readline.parse_and_bind(r'set disable-completion off')
    readline.parse_and_bind(r'set show-all-if-ambiguous off')
    readline.parse_and_bind(r'set show-all-if-unmodified off')
    readline.parse_and_bind(r'Control-a: "{}"'.format(macro))

def pre_input_hook():
    readline.insert_text(inserted)
    readline.redisplay()
if set_pre_input_hook:
    set_pre_input_hook(pre_input_hook)

def completer(text, state):
    if text == "t\xEB":
        if state == 0:
            print("text", ascii(text))
            print("line", ascii(readline.get_line_buffer()))
            print("indexes", readline.get_begidx(), readline.get_endidx())
            return "t\xEBnt"
        if state == 1:
            return "t\xEBxt"
    if text == "t\xEBx" and state == 0:
        return "t\xEBxt"
    return None
readline.set_completer(completer)

def display(substitution, matches, longest_match_length):
    print("substitution", ascii(substitution))
    print("matches", ascii(matches))
readline.set_completion_display_matches_hook(display)

print("result", ascii(input()))
print("history", ascii(readline.get_history_item(1)))
��z[after]s		sx	�
stext 't\xeb'
s#line '[\xefnserted]|t\xeb[after]'
�darwinsindexes 11 13
�set_pre_input_hookssubstitution 't\xeb'
s matches ['t\xebnt', 't\xebxt']
s'[\xefnserted]|t\xebxt[after]'sresult s
shistory )�locale�	setlocale�LC_CTYPErB�sys�flags�	utf8_mode�getencoding�codecs�lookupr2rr!rArC�lenrrL�platformrr)r(�loc�encodingrErxrsrk�expecteds        r�
test_nonascii�TestReadline.test_nonascii�s������v����5���.� �
�M�M�3�C�7�;�<��9�9����)�)�+�H��}�}�X�.�3�3�H��7�"��
�
� 9�(��F�G�	L�� � ��,�2��h��
��3�y�>�)�)��
����
����
������'���
�
�*�F�3��
�
�@�&�I��<�<�8�#�;�;��M�M�.��7��{�w�x�1E�F�F��M�M�6��?��M�M�A�6�J�5���
�
�j�8�+�g�5�v�>�	
�
�
�k�H�,�f�5��c"�	L��M�M�<�v�c�{�J�K�K��	L�s�1F>�>
G0�G+�+G0iz3this readline version does not support history-sizez-editline history size configuration is brokenc	�@�Sn[5n[RRUS5n[	US5nURSU-5 SSS5 [RRUS5n[	US5nSRS[
US-555nURU5 SSS5 S	n[[R5nX8S
'XXS'[USUS
9 [	US5nUR5n	SSS5 UR[W	5U5 URU	SR5S5 SSS5 g!,(df   GN=f!,(df   N�=f!,(df   Nx=f!,(df   g=f)N�
�inputrc�wbsset history-size %d
�historyrc3�,# �UH
nSU-v� M g7f)sitem %d
Nr)�.0�is  r�	<genexpr>�1TestReadline.test_history_size.<locals>.<genexpr>Xs��� B�)@�A�!-�q� 0�)@�s�r z�
import os
import readline

history_file = os.environ["HISTORY_FILE"]
readline.read_history_file(history_file)
input()
readline.write_history_file(history_file)
�INPUTRC�HISTORY_FILEslast input
)rs�env�rb���s
last input)rr6�path�join�open�write�range�dict�environr�	readlinesr"r��strip)
r(�history_size�test_dirr��f�history_file�datarxr��liness
          r�test_history_size�TestReadline.test_history_sizeJsF��
��
�Z�8��g�g�l�l�8�Y�7�G��g�t�$�����0�<�?�@�%��7�7�<�<��)�<�L��l�D�)�Q��x�x� B�).�|�a�/?�)@� B�B������
�	*��F��r�z�z�"�C�$�	�N�".����F�/�s�;��l�D�)�Q����
��*����S��Z��6����U�2�Y�_�_�.�
�>�?�Z�$�$��*�)��,*�)��9�Z�sT�-F�E�4F�6E-�9AF�;E>�AF�
E*	�%F�-
E;	�7F�>
F	�F�
Fc�h�[R"S5n[USS9nURSU5 g)z7gh-123321: readline should be thread-safe and not crasha�
            import threading
            from test.support.threading_helper import join_thread

            def func():
                input()

            thread1 = threading.Thread(target=func)
            thread2 = threading.Thread(target=func)
            thread1.start()
            thread2.start()
            join_thread(thread1)
            join_thread(thread2)
            print("done")
        sinput1
input2
rrsdoneNrtrws   r�test_gh123321_threadsafe�%TestReadline.test_gh123321_threadsafeqs4�����"�
�� ��':�;���
�
�g�v�&rc��[R5nUR[RU5 [R	S5 [R	S5 [R	S5 [RS5 UR[R5S5 [R
[5 UR[R[5 [R[5 g)NrrrIr )rrJr3rKr!r"r4rr6rDr5rMs  rrO�,TestReadline.test_write_read_limited_history�s���"�5�5�7������3�3�_�E����\�*����]�+����\�*��#�#�A�&�����4�4�6��:��#�#�F�+�����	�	�6�*��"�"�6�*rrN)rQrRrSrTrV�skipIfrrrrarerirlroryr�r�r
r�rOrXrrrrZrZ�s���
�_�_�X�/�/�&�8�L��_�<�>�&�>�&�B���4�4�,�&b6�R�_�_�X�/�/�%�7�J�L�
�_�_�[�D�F�!?�F�L�!?�F �!�'�"�'�.
+rrZ�__main__)"rUr�r�r6r�r/rurV�test.supportr�test.support.import_helperr�test.support.os_helperrrr�test.support.pty_helperr�test.support.script_helperr	�test.support.threading_helperr
rrrrrdrrW�TestCaserrZrQ�mainrrr�<module>r�s�����
�	�
���� �4�;�;�+�7�D���$��
�8�0�1�1�%��)K�)K�K�K��"�"�j�0�K�	7�
���W�X��7�>�?�E�x�0�0�E�?�E�Dj+�8�$�$�j+�d�z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit