Python shell under Mavericks: two sides of the readline.so error

Readline issue in Python shell under Mavericks. Two problems, answers here on stackoverflow separately, but not both at the same time. a) segfault after entering the second line and / or b) line editing does not work.

I provide links to both questions below. Basically, you can either A) do nothing and enjoy segfaults when you type the second line in the shell, or B) - "fix" it by renaming readline.so to readline.so.disabled - but in this case you lose editing capabilities in the Python Shell ...

I couldn't find a recipe that solves both problems. And suddenly it's very difficult to use the Python shell. Please, help.

More details:

a) The answer to the segfault question is here and here: Python crashes on running two commands (Segmentation Fault: 11) Segmentation Fault: 11 on OS X

b) the problem with "up arrow" in python interpreter is given here: Seeing escape characters when pressing arrow keys in python shell

Here's how to reproduce the problem on my system:

mymachine:/Library/Frameworks/Python.framework/Versions/2.7%python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x=1
>>> y=2
Segmentation fault
mymachine:/Library/Frameworks/Python.framework/Versions/2.7%sudo mv ./lib/python2.7/lib-dynload/readline.so ./lib/python2.7/lib-dynload/readline.so.disabled

mymachine:/Library/Frameworks/Python.framework/Versions/2.7%python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x=1
>>> y=2
>>> ^[[A
  File "<stdin>", line 1
    ^
SyntaxError: invalid syntax

      

+3


source to share


1 answer


This won't fix your system installation, but I think virtualenv wouldn't have this problem. I use Python every day on Mavericks with virtualenv and never have any problems.



0


source







All Articles