Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Readline and Python 2.6.1 on a Mac

Reply
Thread Tools

Readline and Python 2.6.1 on a Mac

 
 
James Brady
Guest
Posts: n/a
 
      01-15-2009
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?
 
Reply With Quote
 
 
 
 
Ned Deily
Guest
Posts: n/a
 
      01-15-2009
In article
<(E-Mail Removed)>,
James Brady <(E-Mail Removed)> wrote:
> 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>

--
Ned Deily,
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
 
James Brady
Guest
Posts: n/a
 
      01-16-2009

> s/"bind ^I rl_complete"/"tab: complete"/
>
> <http://tiswww.case.edu/php/chet/readline/readline.html>
>
> --
> *Ned Deily,
> *(E-Mail Removed)


Perfect, thanks Ned!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
readline for mac python? (really, reproducing mac python packages) K Richard Pixley Python 3 01-03-2012 05:32 AM
compiling python 3.1.2 with local readline fails to get readline - help! gavino Python 4 09-20-2010 05:17 AM
Getting application ReadLine and Perl debugger ReadLine to cooperate Andrew DeFaria Perl Misc 1 01-30-2008 11:46 PM
Readline::readline() blocking all other threads Jean-Michel Ruby 0 12-22-2007 01:00 AM
TextStream.ReadLine Mac Newline mike.biang@gmail.com ASP General 1 01-09-2007 02:20 PM



Advertisments