Readline not detected / not available with ipython

Bug #1244247 reported by Eero Aaltonen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jython (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ jython ipython.py
WARNING: Readline services not available on this platform.
WARNING: The auto-indent feature requires the readline library
Python 2.5.2 (Debian:hg/91332231a448, Apr 28 2013, 20:48:28)

libreadline-java is installed but is apparently not detected.

$ lsb_release -rd
Description: Ubuntu 13.10
Release: 13.10

$ apt-cache policy jython
jython:
  Installed: 2.5.2-2

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: jython 2.5.2-2
ProcVersionSignature: Ubuntu 3.8.0-31.46-generic 3.8.13.8
Uname: Linux 3.8.0-31-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.12.5-0ubuntu2
Architecture: amd64
Date: Thu Oct 24 17:07:25 2013
InstallationDate: Installed on 2013-09-10 (44 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: jython
UpgradeStatus: Upgraded to saucy on 2013-10-23 (0 days ago)

Revision history for this message
Eero Aaltonen (ejn) wrote :
Revision history for this message
Eero Aaltonen (ejn) wrote :

The problem seems to be with ipython.

I checked java.library.path and java.class.path, both are ok.

In IPython

>>> from org.gnu.readline import Readline

Works without errors.

Revision history for this message
Eero Aaltonen (ejn) wrote :

Re-enactment of what's actually happening inside IPython rlineimpl.py

$ jython
Jython 2.5.2 (Debian:hg/91332231a448, Apr 28 2013, 20:48:28)
[OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_25
Type "help", "copyright", "credits" or "license" for more information.
>>> from readline import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/share/jython/Lib/readline.py", line 20, in <module>
    raise ImportError("Cannot access JLineConsole")
ImportError: Cannot access JLineConsole

Revision history for this message
Eero Aaltonen (ejn) wrote :

If I pass in the options to jython as

jython -Dpython.console=org.python.core.ReadlineConsole -Dpython.console.readlinelib=GnuReadline ipython.py

I get colors (yay!)
and tab completion (yay! :)

However, it turns out that with this setup, the console has problems echoing (displaying) the line contents and the position of the cursor when
-backspace has been pressed
-left arrow has been pressed

:(

I also saw an extra character popped to the display after using tab completion. The actual parsed line did not however contain the extra displayed character.

Revision history for this message
Eero Aaltonen (ejn) wrote :
Revision history for this message
Eero Aaltonen (ejn) wrote :

Depends on bug #1254723

Revision history for this message
Eero Aaltonen (ejn) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.