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
Nothing works in embedded mode after moving from 8.10 to 8.11 #13966
Comments
Thank you for the report, apologies for the regression. I can reproduce the problem with your script. This likely has to do with When I tried to create a smaller minimal reproducible example with: from IPython.terminal.embed import embed; embed() It appears to work just fine, so it seems to be specific to the direct use of This works: from traitlets.config.loader import Config
from IPython.terminal.embed import embed
cfg = Config()
embed(
config=cfg,
banner1="\n***************************\n <Banner> \n***************************\n",
exit_msg="\nExiting...",
) This does not: from traitlets.config.loader import Config
from IPython.terminal.embed import InteractiveShellEmbed
cfg = Config()
InteractiveShellEmbed(
config=cfg,
banner1="\n***************************\n <Banner> \n***************************\n",
exit_msg="\nExiting...",
)() It is not obvious to me what causes this difference. |
Minimal reproducable example: import IPython; console = IPython.terminal.embed.InteractiveShellEmbed(); console() The error can be seen in a fresh virtual environment: python -m venv venv
source venv/bin/activate
pip install ipython
python -c "import IPython; console = IPython.terminal.embed.InteractiveShellEmbed(); console()"
# [press enter] As mentioned by the OP, a downgrade (e.g. In our application we do a bunch of additional setup on the UpdateAfter digging a bit deeper, the issue seems to be introduced by 875ff23 by adding a dependency to To fix this, instead of calling So this works fine for me, but in terms of suggested fixes to IPython maybe it would be cleaner/safer to have the instance be set automatically when launching (rather than instantiating) the console? Update 2Seems the suggested workaround doesn't actually work on Windows (or generally when starting the script with ipython instead of python). So we need to guard the workaround behind an if IPython.core.getipython.get_ipython() is None:
console = IPython.terminal.embed.InteractiveShellEmbed.instance()
else:
console = IPython.terminal.embed.InteractiveShellEmbed() |
@samuelsadok thanks for the detailed analysis and workaround. @krassowski is there a plan to fix this in a newer version of IPython? I imagine this is fix-worthy since it's a regression. |
Yes, I think it should be fixed because current examples are broken. After some thinking, I would say ipython/IPython/terminal/embed.py Line 186 in d016fdb
Any thoughts on such a solution? |
IPython.terminal broke the greatfet shell such that any attempt to use it resulted in an exception ending in: Exception 'NoneType' object has no attribute 'check_complete' This was traced to a change in IPython, version 8.11 and has broken other projects as well, refer to this issue in the IPython project: ipython/ipython#13966 This PR fixes the problem, as suggested in the issue report (linked above). It should be compatible with IPython v8.11 and later, and also backwards compatible for earlier versions of the library as well (as per the above issues last comment). I tested the raw Python script (greatefet_shell.py) but have not managed to generate an install (.egg ?) using the README instructions. The .py file, when run directly, no longer creates an exception and the shell runs normally.
Jug shell fails in newer versions of IPython, see ipython/ipython#13966
Jug shell fails in newer versions of IPython, see ipython/ipython#13966
Jug shell fails in newer versions of IPython, see ipython/ipython#13966
note, I get this same bug just by using the ipython command line. On all my machines. |
Hi @krassowski any updates on the fix for this issue? I didn't reply to your earlier question since I am not really an expert on the internals of IPython and didn't want to give any incorrect answers. |
Since there doesn't seem to be any movement on this, I am assuming this won't be fixed. |
Issue
I am embedding IPython in my command line application. v8.5 to v8.10 work fine but after upgrading to v8.11 nothing works.
The command line starts up, but every command results in
Exception 'NoneType' object has no attribute 'check_complete'
Simple act of starting up the application and pressing 'Enter' also throws the error.
Exception
Application script
The text was updated successfully, but these errors were encountered: