Skip to content

Incompatible with Python 3.11.7 and 3.12.1 #114

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
achimnol opened this issue Dec 9, 2023 · 2 comments · Fixed by #115
Closed

Incompatible with Python 3.11.7 and 3.12.1 #114

achimnol opened this issue Dec 9, 2023 · 2 comments · Fixed by #115

Comments

@achimnol
Copy link
Contributor

achimnol commented Dec 9, 2023

CPython 3.11.7 and 3.12.1 made an internal change (backported from 3.13):
python/cpython@19a266c
and this makes aioconsole to break.
(refs python/cpython#111384, python/cpython#111516)

Just running apython and pressing Enter makes it hanging.
In my test case involving aioconsole, it raises an error:

Traceback (most recent call last):
  File "/home/joongi/.pyenv/versions/aiomon-dev/lib/python3.11/site-packages/aioconsole/server.py", line 14, in handle_connect
    await interface.interact(banner=banner, stop=False, handle_sigint=False)
  File "/home/joongi/.pyenv/versions/aiomon-dev/lib/python3.11/site-packages/aioconsole/console.py", line 160, in interact
    await self._interact(banner)
  File "/home/joongi/.pyenv/versions/aiomon-dev/lib/python3.11/site-packages/aioconsole/console.py", line 204, in _interact
    more = await self.push(line)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/joongi/.pyenv/versions/aiomon-dev/lib/python3.11/site-packages/aioconsole/console.py", line 219, in push
    more = await self.runsource(source, self.filename)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joongi/.pyenv/versions/aiomon-dev/lib/python3.11/site-packages/aioconsole/console.py", line 99, in runsource
    code = self.compile(source, filename, symbol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joongi/.pyenv/versions/3.11.7/lib/python3.11/codeop.py", line 160, in __call__
    return _maybe_compile(self.compiler, source, filename, symbol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joongi/.pyenv/versions/3.11.7/lib/python3.11/codeop.py", line 73, in _maybe_compile
    return compiler(source, filename, symbol, incomplete_input=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: compile_for_aexec() got an unexpected keyword argument 'incomplete_input'

I think aioconsole.execute.compile_for_aexec() method should be updated to work with Python 3.11.7 and 3.12.1.

@achimnol achimnol changed the title Incompatible with Python 3.11.7 Incompatible with Python 3.11.7 and 3.12.1 Dec 9, 2023
@vxgmichel
Copy link
Owner

Thanks a lot @achimnol for the investigation, the report and the fix :)

Release 0.7.0 is now out 🎉

@achimnol
Copy link
Contributor Author

Thanks for quick update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants