[Python-Dev] Hi, and a question about filename completion via readline in Python 2.3

Michael Hudson mwh at python.net
Thu Sep 25 05:54:50 EDT 2003


Fernando Perez <fperez at colorado.edu> writes:

> Besides thanking the python team for this fantastic language, I have a
> question concerning some changes apparently made to the C part of
> readline support for  python 2.3.  If I understood correctly this
> thread:
>
> http://mail.python.org/pipermail/python-list/2002-February/085063.html
>
> as of python 2.3, readline will NOT default anymore to providing
> filename completions when nothing matches in the available namespaces.
> There is mention in that thread of making it a configurable parameter,
> but I failed to find any specifics on how to do that.
>
> While perhaps I'm missing something, so far (after getting this
> reported as an ipython bug from 2.3 users) I've failed to be able to
> recover filename completion under 2.3.
>
> While I'm sure you found good reasons for this change, under some
> environments it turns out to be really quite nasty.  One of the
> strengths of ipython is its tight integration with the underlying
> system environment, and its users rely constantly on
> filename/directory completion for navigating their filesystem as they
> work.  I personally (and many others) use ipython as my main python
> shell, and I fell it provides a superior working environment to
> anything else I've seen out there (especially if you need to combine
> python work with manipulating underlying files).

Bet pyrepl still canes it for multi-line work :-)

> So ultimately my concerns are:
>
> - is there currently a way to re-enable readline filename completion,
>   as suggested in that thread?

Yes.  Do it yourself, in your completer function.  Is it really that
hard?  I would have thought os.path + glob would make it a five line
or so excercise.

> - if not, can such a change be made?

Well, I'm not going to <wink>.  Feel free to submit a patch.

Cheers,
mwh

-- 
  You owe the Oracle a star-spangled dunce cap.
                 -- Internet Oracularity Internet Oracularity #1299-08



More information about the Python-Dev mailing list