Readline and Python 2.6.1 on a Mac

J

James Brady

Hi, I just upgraded Python from 2.5.2 up to 2.6.1 on my 10.5 Mac
(installed from the DMG here: http://www.python.org/download/releases/2.6.1/),
and I'm having some problems with readline and rl_completer.

I have PYTHONSTARTUP pointing to this file:
#!/usr/bin/env python

try:
import readline
except ImportError:
print "Module readline not available."
else:
import rlcompleter
readline.parse_and_bind("bind ^I rl_complete")

Which was working fine for tab completion in 2.5. Now, however, I
can't enter 'b' (lower case b) in interactive python shells - no
character appears.

Just b is broken - 'B' is fine, Ctrl-b is fine, Alt-b even prints an
integration symbol, but 'b' - nothing!

Has anyone seen this before?
 
N

Ned Deily

Hi, I just upgraded Python from 2.5.2 up to 2.6.1 on my 10.5 Mac
(installed from the DMG here: http://www.python.org/download/releases/2.6.1/),
and I'm having some problems with readline and rl_completer.

I have PYTHONSTARTUP pointing to this file:
#!/usr/bin/env python

try:
import readline
except ImportError:
print "Module readline not available."
else:
import rlcompleter
readline.parse_and_bind("bind ^I rl_complete")

Which was working fine for tab completion in 2.5. Now, however, I
can't enter 'b' (lower case b) in interactive python shells - no
character appears.

Your startup file was set up for a Python (likely the Apple-supplied
2.5) that was built using the BSD editline library for readline. But
the 2.6 python.org python was built with GNU readline which uses a
different syntax.

s/"bind ^I rl_complete"/"tab: complete"/

<http://tiswww.case.edu/php/chet/readline/readline.html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top