Readline and Python 2.6.1 on a Mac

Discussion in 'Python' started by James Brady, Jan 15, 2009.

  1. James Brady

    James Brady Guest

    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?
     
    James Brady, Jan 15, 2009
    #1
    1. Advertising

  2. James Brady

    Ned Deily Guest

    In article
    <>,
    James Brady <> 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,
     
    Ned Deily, Jan 15, 2009
    #2
    1. Advertising

  3. James Brady

    James Brady Guest


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


    Perfect, thanks Ned!
     
    James Brady, Jan 16, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gavino
    Replies:
    4
    Views:
    565
    gavino
    Sep 20, 2010
  2. TextStream.ReadLine Mac Newline

    , Jan 8, 2007, in forum: ASP General
    Replies:
    1
    Views:
    179
  3. K Richard Pixley
    Replies:
    3
    Views:
    366
    Ned Deily
    Jan 3, 2012
  4. Jean-Michel
    Replies:
    0
    Views:
    388
    Jean-Michel
    Dec 22, 2007
  5. Andrew DeFaria
    Replies:
    1
    Views:
    240
    Ben Morrow
    Jan 30, 2008
Loading...

Share This Page