[Pythonmac-SIG] readline support for OS X Leopard

Ronald Oussoren ronaldoussoren at mac.com
Wed Nov 21 17:02:57 CET 2007


 
On Wednesday, November 21, 2007, at 04:48PM, "Nicholas Riley" <njriley at uiuc.edu> wrote:
>On Mon, Oct 22, 2007 at 08:02:09AM -0500, skip at pobox.com wrote:
>> Just install GNU readline and point the build system at it.  For example, I
>> have MacPorts (http://www.macports.org/) installed in /opt/local.  GNU
>> readline is installed there, and my readline module is linked against that:
>
>IPython brokenness (specifically autoindent and bizarre behavior when
>replacing the line, e.g. with ^U) started bothering me enough that I
>did this:

Do you have an ADC account? If so, could you please file a bug at bugreport.apple.com? That way there is at least a small chance that this bug gets fixed in a future release of OSX (and that someone that actually cares about this gets notified when Apple says it has fixed this issue). 

>
>% otool -L /Library/Python/2.5/site-packages/readline.so 
>/Library/Python/2.5/site-packages/readline.so:
>	/opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0)
>	/opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
>	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
>	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)
>
>but I can't figure out how to get this version of readline to replace
>the bundled one.  I put readline.so into ipython-0.8.1-py2.5.egg,
>which works for IPython, but is there a nicer way to do so in general
>than simply overwriting it in
>/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload?

If you install your version of readline as an egg (through setuptools) it will be earlier in sys.path than the system version of readline. Alternatively you can use a pth-file that inserts the directory with your copy of readline.so early in sys.path.

Ronald



More information about the Pythonmac-SIG mailing list