[IPython-user] readline and leopard revisited

Brian Granger ellisonbg.net@gmail....
Thu Jan 17 10:37:32 CST 2008


Ludwig,

I just tried this and it works perfect.  This is truly fantastic and
makes Leopard's Python usable.  I will use this for a few days and if
things still look great, we should post this on the IPython website if
that is OK with you?

Thanks for tackling this persistent annoying issue.

Brian

On Jan 17, 2008 5:37 AM, Ludwig Schwardt <ludwig.schwardt@gmail.com> wrote:
> Hi,
>
> After a few useful hints from Ville and a Japanese forum
> (http://www.python.jp/pipermail/python-ml-jp/2007-October/004150.html),
> I reworked my readline extension build process. It now builds a
> statically linked extension module which is installed as a Python egg.
>
> It seems to work with the system-installed Python 2.5.1 on Leopard
> 10.5.1. IPython 0.8.1 correctly picks up the new version, and now has
> tab completion and ctrl-r search.
>
> I attach a "lite" version of the extension - just unpack, add
> readline-5.2.tar.gz from somewhere, and run ./build.sh. A full version
> could be sent on request, which includes the readline tarball for
> about 2MB extra. Both versions include all recent readline patches.
> Especially patch 12 is relevant, as this fixes configure support for
> Leopard. The build script contains some commented-out lines for
> enabling a 4-way universal build based on the 10.5 SDK, like the rest
> of the system Python (not required, it seems).
>
> Ville: You spotted the correct reason for my troubles - I was being
> too clever and ended up linking against the system readline instead of
> the real one, leading to some insidious behaviour...
>
> Enjoy and let me know of any problems.
> Ludwig
>
> P.S. If you don't like eggs, it is reasonably straightforward to fix:
>
> 1. Unpack pyreadline-2.5.1.tar.gz
>
> 2. In pyreadline-2.5.1/setup.py, change the 3 lines:
>
> import ez_setup
> ez_setup.use_setuptools()
> from setuptools import setup, Extension
>
>     to:
>
> from distutils.core import setup, Extension
>
>     Also comment out the second-last line:
>
> zip_safe=False,
>
> 3. Recreate the tarball and run ./build.sh, which now installs to site-packages.
>
> 4. Add a file 'sitecustomize.py' to site-packages, which contains
> (change the path to something appropriate):
>
> import imp
> imp.load_dynamic('readline', '/Library/Python/2.5/site-packages/readline.so')
>
> _______________________________________________
> IPython-user mailing list
> IPython-user@scipy.org
> http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
>
>


More information about the IPython-user mailing list