Macports and python 2.5
Some weeks ago I upgraded my macbook from Tiger to Leopard. Right after the upgrade, I installed the usual tools I need for work, like Python, using MacPorts.
Everything was ok, but one thing keeps annoying me all this time... until some minutes ago.
When using the python console, I got a weird behaviour when trying to get entries from the console buffer, and things like that. Let's see it with an example:
snowball:~ wu$ python Python 2.5.2 (r252:60911, Apr 29 2008, 23:50:14) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> ^[[A
That's what I got when pressing up to access the import os command I just executed before. Some other things didn't work as expected, like pressing the tab key for indentation... pretty annoying.
It didn't help that it only happened with the 2.5 version of the interpreter, python 2.4 worked fine.
Just a while ago, I find the solution for that little problem, installing the py25-readline package:
snowball:~ wu$ sudo port -v install py25-readline
Seems like the people behind MacPorts separate some python 2.5 components into separate subpackages (that's why python2.4 didn't have such problem).
After installed that package, I can enjoy the interpreter experience as usual:
snowball:~ wu$ python Python 2.5.2 (r252:60911, Apr 29 2008, 23:50:14) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> import os
(the second import os appeared when pressing up to access the buffer contents).