Skip to content

AttributeError: module 'readline' has no attribute 'backend' in 3.13.0a3 #117669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pjyan opened this issue Apr 9, 2024 · 4 comments
Closed

AttributeError: module 'readline' has no attribute 'backend' in 3.13.0a3 #117669

pjyan opened this issue Apr 9, 2024 · 4 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@pjyan
Copy link

pjyan commented Apr 9, 2024

Bug report

Bug description:

python 3.13.0a3
readline-6.2.4.1-cp313-cp313-linux_x86_64

Python 3.13.0a3 (main, Apr  9 2024, 14:10:32) [GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
  File "<frozen site>", line 479, in register_readline
AttributeError: module 'readline' has no attribute 'backend'
>>>
Stack trace of thread 81129:
0  0x0000000000522c24 _PyInterpreterState_GET (python3.13)
1  0x00007fe96977ccda call_readline (readline.cpython-313-x86_64-linux-gnu.so)
2  0x0000000000469937 PyOS_Readline (python3.13)
3  0x0000000000467100 tok_underflow_interactive (python3.13)
4  0x0000000000462add tok_nextc (python3.13)
5  0x0000000000466403 tok_get (python3.13)
6  0x0000000000431a29 _PyPegen_fill_token (python3.13)
7  0x0000000000460fb8 statement_newline_rule (python3.13)
8  0x0000000000432c7c _PyPegen_run_parser (python3.13)
9  0x0000000000432f52 _PyPegen_run_parser_from_file_pointer (python3.13)
10 0x0000000000651e75 pyrun_one_parse_ast (python3.13)
11 0x0000000000652c00 _PyRun_InteractiveLoopObject (python3.13)
12 0x0000000000653d46 _PyRun_AnyFileObject (python3.13)
13 0x000000000068550d pymain_run_stdin (python3.13)
14 0x0000000000685998 Py_RunMain (python3.13)
15 0x00007fe976769b17 __libc_start_main (libc.so.6)
16 0x00000000004311ea _start (python3.13)

CPython versions tested on:

3.13

Operating systems tested on:

Linux

@pjyan pjyan added the type-bug An unexpected behavior, bug, or error label Apr 9, 2024
@graingert
Copy link
Contributor

graingert commented Apr 9, 2024

I'm not sure what you mean by readline-6.2.4.1-cp313-cp313-linux_x86_64 is it the pypi package? If so https://pypi.org/project/readline/6.2.4.1/ is deprecated and has been renamed to https://pypi.org/project/gnureadline/

You should upgrade to see if your problem still exists, if so this is probably not an issue cpython can resolve and something the gnureadline maintainers will need to fix

@pjyan
Copy link
Author

pjyan commented Apr 9, 2024

I'm not sure what you mean by readline-6.2.4.1-cp313-cp313-linux_x86_64 is it the pypi package? If so https://pypi.org/project/readline/6.2.4.1/ is deprecated and has been renamed to https://pypi.org/project/gnureadline/

You should upgrade to see if your problem still exists, if so this is probably not an issue cpython can resolve and something the gnureadline maintainers will need to fix

Hi,Thanks a lot. while trying to install gnureadline-8.1.2 , here is an error.
my gcc version 7.3.0 (GCC), should I update it?

      Modules/3.x/clinic/readline.c.h:34:10: warning: implicit declaration of function ‘_PyArg_CheckPositional’; did you mean ‘PyErr_CheckSignals’? [-Wimplicit-function-declaration]
           if (!_PyArg_CheckPositional("read_init_file", nargs, 0, 1)) {
                ^~~~~~~~~~~~~~~~~~~~~~
                PyErr_CheckSignals
      In file included from Modules/3.x/readline.c:943:0:
      Modules/3.x/clinic/readline.c.h: In function ‘readline_append_history_file’:
      Modules/3.x/clinic/readline.c.h:143:17: warning: implicit declaration of function ‘_PyLong_AsInt’; did you mean ‘PyLong_AsInt’? [-Wimplicit-function-declaration]
           nelements = _PyLong_AsInt(args[0]);
                       ^~~~~~~~~~~~~
                       PyLong_AsInt
      Modules/3.x/clinic/readline.c.h: In function ‘readline_replace_history_item’:
      Modules/3.x/clinic/readline.c.h:441:9: warning: implicit declaration of function ‘_PyArg_BadArgument’; did you mean ‘PyErr_BadArgument’? [-Wimplicit-function-declaration]
               _PyArg_BadArgument("replace_history_item", "argument 2", "str", args[1]);
               ^~~~~~~~~~~~~~~~~~
               PyErr_BadArgument
      Modules/3.x/readline.c: In function ‘readline_until_enter_or_signal’:
      Modules/3.x/readline.c:1356:34: error: ‘_PyOS_ReadlineTState’ undeclared (first use in this function); did you mean ‘PyOS_Readline’?
                   PyEval_RestoreThread(_PyOS_ReadlineTState);
                                        ^~~~~~~~~~~~~~~~~~~~
                                        PyOS_Readline
      Modules/3.x/readline.c:1356:34: note: each undeclared identifier is reported only once for each function it appears in
      Modules/3.x/readline.c: In function ‘call_readline’:
      Modules/3.x/readline.c:1387:5: warning: implicit declaration of function ‘_Py_SetLocaleFromEnv’ [-Wimplicit-function-declaration]
           _Py_SetLocaleFromEnv(LC_CTYPE);
           ^~~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

@graingert
Copy link
Contributor

_PyOS_ReadlineTState was removed from cpython 3.13 #112446

You will need to ask gnureadline maintainers to release a new version with 3.13 support

@graingert graingert closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
@pjyan
Copy link
Author

pjyan commented Apr 9, 2024

_PyOS_ReadlineTState was removed from cpython 3.13 #112446

You will need to ask gnureadline maintainers to release a new version with 3.13 support

ty, that's helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants