Opened 9 years ago

Closed 9 years ago

#48911 closed defect (duplicate)

Output problem with Python 3.5 REPL

Reported by: ronf (Ron Frederick) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc:
Port: python35

Description

I installed the Python 3.5 port (@3.5.0) today on my 2011 iMac running Yosemite 10.10.5. When I tried to use the interactive read-eval-print loop, I saw an immediate problem with the printing of the prompt:

Python 3.5.0 (default, Sep 15 2015, 23:58:24) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+2
>>> 3

The second ">>>" prompt was printed before the result of the evaluation. This same output on Python 3.4 is:

Python 3.4.3 (default, Sep  4 2015, 09:52:14) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+2
3
>>> 

With 3.5, the prompt is printed too early and the cursor ends up on a blank line, but it does properly still accept another expression, repeating the problem with the prompt again on that evaluation. Hitting Ctrl-D to exit also prints an extra prompt before exiting:

Python 3.5.0 (default, Sep 15 2015, 23:58:24) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+2
>>> 3
3+4
>>> 7
^D>>> 

After a bit more experimentation, I was able to produce a similar problem with the Python 3.4 port, but only when I uninstalled the "py34-readline" package. In that case, both Python 3.4 (@3.4.3_5) and Python 3.5 (@3.5.0) have this issue. However, with "py34-readline" installed, the problem goes away. Unfortunately, there's no "py35-readline" package yet, so I can't test that as a possible solution.

Change History (3)

comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Looks related to #48807.

comment:2 Changed 9 years ago by ronf (Ron Frederick)

Agreed. While I didn't see the problem with input not echoing, and the tty mode didn't end up broken when I exited Python, the issues are definitely related.

Also, I see from the other ticket that py35-readline has now been added as a port, and installing that does work around the problem, just as I noted above for Python 3.4. Thanks for providing a pointer to that!

comment:3 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.