In article <7b7f018e-b429-448b-94c1-2a812c5f3...@h37g2000pro.googlegroups.com>, Nik Krumm <nkr...@gmail.com> wrote: > The issue isn't with readline. The readline module or rlcompleter > module are both available, and loading them has no effect on the > behavior of tab: > > >>> import readline > [Now i hit tab...] > >>> ./ > File "<stdin>", line 1 > ./ > ^ > SyntaxError: invalid syntax > > [Hit tab twice...] > >>> ./ > ./.bash_history ./.bash_profile ./.bash_profile.pysave [...] > So this ostensibly makes it very hard to write or paste any code into > the command line!
Ah, thanks, I get it now. It turns out this is a bug seen for the first time with the new-style (32-/64-, 10.5+) python.org 2.7 installer build because it links with the Apple-supplied editline library rather than the GNU readline library as in other installers. I've opened an issue for this: http://bugs.python.org/issue9907 As noted there, two workarounds come to mind. Either switch to using the old-style (32-only, 10.3+) 2.7 installer; or, add or modify a PYTHONSTARTUP file to force the desired TAB behavior, so something like this: $ cat > $HOME/.pystartup import readline if 'libedit' in readline.__doc__: readline.parse_and_bind("bind ^I ed-insert") ^D $ export PYTHONSTARTUP=$HOME/.pystartup Thanks for reporting this! -- Ned Deily, n...@acm.org -- http://mail.python.org/mailman/listinfo/python-list