Strange Problems With Python After Upgrading to OS

2019-03-31 20:56发布

After upgrading my OS X Lion to Mavericks, I've encountered with strange problems. At first, It gave me segmentation fault or bus error. After searching for a bit I've noticed that it's related to the readline library. The solution was described by bugs.python.org:

curl -O http://bugs.python.org/file32324/patch_readline_issue_18458.sh 
openssl sha1 patch_readline_issue_18458.sh # the digest should be 7cb0ff57820a027dd4ca242eb2418930f8f46b4c 
sudo sh ./patch_readline_issue_18458.sh

This will disable the readline library. The errors are gone now but I have another problem. In Python shell when I press arrow keys (up, down, left or right) it gives me these: ^[[A, [[C^, ^[[B, ^[[D. I think the problem is still related to the readline library but I don't know how to solve it.

Thanks in advance.

Regards

2条回答
一夜七次
2楼-- · 2019-03-31 21:13

The (brand new) Python 3.3.3rc1 fixes the SegFault problem.

It's here: http://www.python.org/download/releases/3.3.3/

查看更多
Root(大扎)
3楼-- · 2019-03-31 21:31

I'm no authority on the guts of Python, so take my advice with caution. But, having encountered the same problem after the Mavericks upgrade (and using Python 2.7), I just did a

easy_install readline

at the command line, and everything seems to be working again. No more segmentation error, and arrow keys in the Python shell appear to be functioning normally.

查看更多
登录 后发表回答