ipython / rlipython

Readline Interface for IPython 5.4+
Other
32 stars 10 forks source link

Oops - crash on IPython 7 #21

Open matthew-brett opened 6 years ago

matthew-brett commented 6 years ago

I have extra need of readline, now prompt_toolkit seems to be broken for IPython 7:

https://github.com/ipython/ipython/issues/1133

But sadly, with IPython 7, current rlipython

$ ipython
Python 3.6.4 (default, Mar 22 2018, 14:11:17) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.0.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import os
Traceback (most recent call last):
  File "/Users/brettmz/.virtualenvs/dsfe/bin/ipython", line 11, in <module>
    sys.exit(start_ipython())
  File "/Users/brettmz/.virtualenvs/dsfe/lib/python3.6/site-packages/IPython/__init__.py", line 125, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/Users/brettmz/.virtualenvs/dsfe/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/Users/brettmz/.virtualenvs/dsfe/lib/python3.6/site-packages/IPython/terminal/ipapp.py", line 356, in start
    self.shell.mainloop()
  File "/Users/brettmz/dev_trees/rlipython/rlipython/shell.py", line 454, in mainloop
    self.interact(display_banner=display_banner)
  File "/Users/brettmz/dev_trees/rlipython/rlipython/shell.py", line 571, in interact
    self.input_splitter.push(line)
AttributeError: 'TransformerManager' object has no attribute 'push'

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

I did try patching it up, but I soon got lost. But I tried. Honest.

Carreau commented 6 years ago

Yeah the transformer APi have been changed to be simpler. rl ipython have not been updated to use it.

prittjam commented 5 years ago

As I understand it, rlipython is not usable with ipython 7.x? I have the same problem.

luckjiff commented 5 years ago

rlipython rocks! It was the only way I found to make emacs work with ipython 6.2.1 and have completion in the inferior shell. But you guys know this already. Why why why was prompt toolkit brought it without providing for readline? There are a lot of us emacs/python folks out here still right? Maybe not in 20 years... :)

WaterSibilantFalling commented 5 years ago

great. so now I can't use ipython, 'cos it crashes on startup.

You do realize that you - the rlipython programmers - have ruined ipython for everyone who has installed rlipython?

Carreau commented 5 years ago

"""Hi,

I really appreciate the work that you are doing providing IPython and many of its extensions for free and all the free time you spend developing open source. I understand that this is not a project I paid for, so I am not entitled to any specific treatment, not any guarantee of working software;

Nevertheless this issue has notebook me and made IPython hard to use on my system as I have to choose between rlipython and the new features.

I would love for this issue to be fixed; is there anything I can do to free some of your time so you can work on it ? I'm also willing to try to fix it myself but I would need some pointer.

I understand that being a maintainer is hard, and that burnout is always near especially when confronted with rides comments.

Much appreciation for your software and your help.

Thanks. """ On Tue, Mar 26, 2019, 19:33 Stephen McGregor notifications@github.com wrote:

great. so now I can't use ipython, 'cos it crashes on startup.

You do realize that you have ruined ipython for everyone who has installed rlipython?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ipython/rlipython/issues/21#issuecomment-476941707, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUez3Jyox-b_iQoiiD5fwzkgfZze4i1ks5vathogaJpZM4XZNVe .

keflavich commented 5 years ago

I'm trying to find a fix, but haven't gotten too far yet. Just some notes in case anyone else wants to keep on with this: input_splitter is now a property of InteractiveShell that points to inputtransformer2.TransformerManager. I'm not sure which method of that to use instead of push, though... that will take some more reading.

WaterSibilantFalling commented 5 years ago

EDIT: maybe this is the wrong bug/issue/ticket

I don't know if this helps, but after I tried to uninstall rlipython:

$ python -m pip uninstall rlipython
WARNING: Skipping rlipython as it is not installed.

I still cannot use ipython:

$ ipython3
=========
 IPython
=========

Tools for Interactive Computing in Python
=========================================
       :
       :
       :     <snip>
       :
       :
[TerminalIPythonApp] CRITICAL | Bad config encountered during initialization:
[TerminalIPythonApp] CRITICAL | The 'interactive_shell_class' trait of <IPython.terminal.ipapp.TerminalIPythonApp object at 0x000001A4ED6B1940> instance must be a type, but 'rlipython.TerminalInteractiveShell' could not be imported

(doesn't run)