• Re: unable to resolve readline issues

    From Eryk Sun@21:1/5 to biglee12672@gmail.com on Sun Dec 4 14:08:36 2022
    On 12/2/22, biglee12672@gmail.com <biglee12672@gmail.com> wrote:

    From this point on Python became unusable as I uninstalled rebooted then reinstalled to find I have the same issues as stated. Finally uninstalled Python as it doesn't perform as usual especially trying to understand the
    use of pyreadline, gnureadline and or just readline.

    When Python runs interactively, it implicitly tries to import the
    readline module. On POSIX, Python has a builtin readline module that
    usually uses the GNU Readline library.

    On Windows, Python does not include a readline module. Instead, if
    standard I/O is a console, the high-level WinAPI ReadConsoleW()
    function is used, which implements its own line editor and
    command-line history. It's not as general, flexible, or capable as the
    readline interface, so a third-party pyreadline package was
    implemented for Windows. However, as far as I know, pyreadline is no
    longer actively developed. Thus it has out-of-date code, which may be
    broken in newer releases of Python, such as isinstance(x, collections.Callable).

    Your choice is to either patch pyreadline to fix the bug or uninstall it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From biglee12672@gmail.com@21:1/5 to All on Fri Dec 2 14:38:03 2022
    Dear Sir:



    For whatever reason I have lost functionality of using Python 3.11. While opening Python (standalone or from CMD prompt) as usual this AM the
    following message appeared. Did read that it is not compatible with
    Windows but I can't get it to work as I don't know what module will load.



    Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32

    Type "help", "copyright", "credits" or "license" for more information.

    Failed calling sys.__interactivehook__

    Traceback (most recent call last):

    File "<frozen site>", line 445, in register_readline

    File "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\re adline.py", line 34, in <module>

    rl = Readline()

    ^^^^^^^^^^

    File "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py readline\rlmain.py", line 422, in __init__

    BaseReadline.__init__(self)

    File "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py readline\rlmain.py", line 62, in __init__

    mode.init_editing_mode(None)

    File "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py readline\modes\emacs.py", line 633, in init_editing_mode

    self._bind_key('space', self.self_insert)

    File "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py readline\modes\basemode.py", line 162, in _bind_key

    if not callable(func):

    ^^^^^^^^^^^^^^

    File "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py readline\py3k_compat.py", line 8, in callable

    return isinstance(x, collections.Callable)rer

    ^^^^^^^^^^^^^^^^^^^^

    AttributeError: module 'collections' has no attribute 'Callable'



    From this point on Python became unusable as I uninstalled rebooted then reinstalled to find I have the same issues as stated. Finally uninstalled Python as it doesn't perform as usual especially trying to understand the
    use of pyreadline, gnureadline and or just readline.



    If you can help great.



    Regards,

    Leon Pearlman

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From MRAB@21:1/5 to biglee12672@gmail.com on Sun Dec 4 20:18:28 2022
    On 2022-12-02 22:38, biglee12672@gmail.com wrote:
    Dear Sir:

    For whatever reason I have lost functionality of using Python 3.11.
    While
    opening Python (standalone or from CMD prompt) as usual this AM the following message appeared. Did read that it is not compatible with Windows but I can't get it to work as I don't know what module will load.

    Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit
    (AMD64)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information. Failed calling sys.__interactivehook__
    Traceback (most recent call last):
    File "<frozen site>", line 445, in register_readline
    File
    "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\readline.py",
    line 34, in <module>
    rl = Readline()
    ^^^^^^^^^^
    File
    "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\rlmain.py",
    line 422, in __init__
    BaseReadline.__init__(self)
    File
    "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\rlmain.py",
    line 62, in __init__
    mode.init_editing_mode(None)
    File
    "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\modes\emacs.py",
    line 633, in init_editing_mode
    self._bind_key('space', self.self_insert)
    File
    "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\modes\basemode.py",
    line 162, in _bind_key
    if not callable(func):
    ^^^^^^^^^^^^^^
    File
    "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\py3k_compat.py",
    line 8, in callable
    return isinstance(x, collections.Callable)rer
    ^^^^^^^^^^^^^^^^^^^^
    AttributeError: module 'collections' has no attribute 'Callable'

    From this point on Python became unusable as I uninstalled rebooted
    then
    reinstalled to find I have the same issues as stated. Finally
    uninstalled
    Python as it doesn't perform as usual especially trying to understand the use of pyreadline, gnureadline and or just readline.

    If you can help great.

    Regards,
    Leon Pearlman

    Looking at PyPI, it appears that it was last supported on Python 3.5.

    I'd suggest that after uninstalling Python, you delete the Python folder
    if it's still there (because of any installed 3rd-party modules) before re-installing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Sabrina_Almod=c3=b3var?=@21:1/5 to Eryk Sun on Sun Dec 4 20:36:19 2022
    On 04/12/2022 17:08, Eryk Sun wrote:
    On 12/2/22, biglee12672@gmail.com <biglee12672@gmail.com> wrote:

    From this point on Python became unusable as I uninstalled rebooted then
    reinstalled to find I have the same issues as stated. Finally uninstalled >> Python as it doesn't perform as usual especially trying to understand the
    use of pyreadline, gnureadline and or just readline.

    When Python runs interactively, it implicitly tries to import the
    readline module. On POSIX, Python has a builtin readline module that
    usually uses the GNU Readline library.

    On Windows, Python does not include a readline module. Instead, if
    standard I/O is a console, the high-level WinAPI ReadConsoleW()
    function is used, which implements its own line editor and
    command-line history. It's not as general, flexible, or capable as the readline interface, so a third-party pyreadline package was
    implemented for Windows. However, as far as I know, pyreadline is no
    longer actively developed. Thus it has out-of-date code, which may be
    broken in newer releases of Python, such as isinstance(x, collections.Callable).

    Your choice is to either patch pyreadline to fix the bug or uninstall it.

    (*) How to patch it

    Open the file

    Lib/site-packages/pyreadline/py3k_compat.py

    and locate the procedure

    def callable(x):
    return isinstance(x, collections.Callable)

    Change it to

    def callable(x):
    return isinstance(x, collections.abc.Callable)

    You're done.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mats Wichmann@21:1/5 to Eryk Sun on Mon Dec 5 08:25:44 2022
    On 12/4/22 13:08, Eryk Sun wrote:
    On 12/2/22, biglee12672@gmail.com <biglee12672@gmail.com> wrote:

    From this point on Python became unusable as I uninstalled rebooted then
    reinstalled to find I have the same issues as stated. Finally uninstalled >> Python as it doesn't perform as usual especially trying to understand the
    use of pyreadline, gnureadline and or just readline.

    When Python runs interactively, it implicitly tries to import the
    readline module. On POSIX, Python has a builtin readline module that
    usually uses the GNU Readline library.

    On Windows, Python does not include a readline module. Instead, if
    standard I/O is a console, the high-level WinAPI ReadConsoleW()
    function is used, which implements its own line editor and
    command-line history. It's not as general, flexible, or capable as the readline interface, so a third-party pyreadline package was
    implemented for Windows. However, as far as I know, pyreadline is no
    longer actively developed. Thus it has out-of-date code, which may be
    broken in newer releases of Python, such as isinstance(x, collections.Callable).

    Your choice is to either patch pyreadline to fix the bug or uninstall it.

    there is a pyreadline3

    I tried it for a particular case and didn't have a whole lot of luck
    with it, so YMMV, but somebody has done the porting work to keep it more current.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)