2
1
My python2.7 from macports seems to mess up with osx terminal in a weird way. Here is what I mean.
The exact input from the keyboard was:
/opt/local/bin/python2.7<ENTER>
a = 3<ENTER>
a<ENTER>
<CTRL+D>
/opt/local/bin/python2.7<ENTER>
a = 3<ENTER>
a<ENTER>
<CTRL+D><ENTER>
exit()<ENTER>
<ENTER>
ls
And here's what I saw in the terminal window:
Artems-MacBook-Pro-2 /Users/artem $ /opt/local/bin/python2.7
Python 2.7.10 (default, Aug 31 2015, 01:42:42)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 3
>>> a
>>> 3
a
>>> 3
^D>>>
Artems-MacBook-Pro-2 /Users/artem $ Python 2.7.10 (default, Aug 31 2015, 01:42:42)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 3
>>> a
>>> 3
a
>>> 3
^D
>>> exit()
>>> Artems-MacBook-Pro-2 /Users/artem $
Artems-MacBook-Pro-2 /Users/artem $ ls
As you can see, the first weird thing happens when I try to print the value of 'a' for the first time, i.e. I get
>>> a
>>> 3
<cursor here>
instead of
>>> a
3
>>> <cursor here>
Then, after exiting from python for the first time no input is being shown in the terminal, i.e. I get:
Artems-MacBook-Pro-2 /Users/artem $ Python 2.7.10 (default, Aug 31 2015, 01:42:42)
instead of
Artems-MacBook-Pro-2 /Users/artem $ /opt/local/bin/python2.7
Python 2.7.10 (default, Aug 31 2015, 01:42:42)
The second python session keep behaving weirdly + the CTRL+D keys combination stops to work. After quitting from this second session the input is seen fine again in the terminal.
Does anyone have a clue why this is happening and how to fix it?
P.S. The default python from OSX doesn't have this issue, but I really want to make the macports version to work
A ticket was filed a while ago. A fix should be coming soon. – fd0 – 2015-09-20T15:30:04.667
Interesting! Do you have the URL by any chance? – Matt Zucker – 2015-09-20T16:01:30.197
Yes, https://trac.macports.org/attachment/ticket/48807/readline.patch
– fd0 – 2015-09-20T16:09:09.750Thank you! I experienced exactly the same thing and the install of py27-readline fixed it. – Bogatyr – 2015-09-27T20:26:42.603