syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.89k forks source link

Org babel Python code block with :session hangs Emacs 28. #15620

Closed srgkoshelev closed 1 year ago

srgkoshelev commented 2 years ago

Description :octocat:

Org babel Python code block with :session hangs Emacs 28. This happens on brew cask aka emacsformacos.com, emacs-plus, and emacs-mac. It works on emacsformacos.com version 27 and emacs-plus@27.

It is worth mentioning that starting python with M-x run-python and inputing any commands there leads to input echoed to the output. Online search led to some recommendations of installing gnureadline (using brew) or pyreadline (using pip), none of which helped =(

Also, if python has been started using M-x run-python and the code block executed after, this kind of error is returned instead of freezing: : __PYTHON_EL_eval("try:\n with open('/var/folders/rq/v68ffv5s7lgc370y5pg65vgm0000gr/T/babel-optvAh/python-A9aezU') as __org_babel_python_tmpfile:\n exec(compile(__org_babel_python_tmpfile.read(), __org_babel_python_tmpfile.name, 'exec'))\nexcept:\n raise\nfinally:\n print('

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: Emacs is frozen.

Expected behaviour: :heart: :smile: Code block executed, results obtained, salary paid.

System Info :computer:

Backtrace :paw_prints:

<<BACKTRACE IF RELEVANT>>
codelahoma commented 2 years ago

I just ran into this myself (same system info as @srgkoshelev, other than layers). If I start up a python REPL using spacemacs/python-start-or-switch-repl (triggered with ,' while in an edit buffer for one of the code blocks, then the session works.

If I forget to do that, I end up having to Force Quit.

lebensterben commented 2 years ago

Cannot produce this bug on Linux.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!