-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Crash when doing "import math; math.sin?" #10229
Comments
Ping @jonathanslenders - I was only able to reproduce this after upgrading prompt_toolkit, so I think a recent change must have broken what we do. It looks like we should be setting a Document instead of a string? |
#10231 fixes it at least on sufficiently recent prompt_toolkit; I haven't checked how recent it needs to be. |
I can reproduce this (exact same error message) with a simpler command:
It's likely the same problem but, just in case, you might want to check if the fix works for both. Thanks! |
Thanks, I believe that the problem & the fix don't depend on the details of what you enter - anything that calls |
Closes gh-10229 Please don't merge this just yet. jonathanslenders I discovered after updating that we can no longer set text in the buffer with a `pre_run` function, because `pre_run_callables` reset the buffer immediately after that. I've worked around this by adding another callable to `pre_run_callables` which sets the text that I want, but I don't know if this is the right way to do it, or whether it works with previous releases of prompt_toolkit.
In the IPython session below, I executed
and
When doing this, IPython crashes.
Below, you will see
In [3]: import math; math.sin?
but I have no idea where that came from. That was just displayed automatically.The text was updated successfully, but these errors were encountered: