Can't use interactive console, shows with ">?" instead of ">>>" prompt

Answered

Hej,

After upgrading to 2016.3.2, the interactive console doesn't respond to any commands entered in it. Before the update, I would click on the "Open debug command line" and the prompt would look lile ">?", after pressing ENTER once, it would go to ">>>" and then work properly (if I entered a command while it had the '?' symbol, nothing would happen). After updating to the latest 2016.3.2, the interactive console's prompt stays >? even after presing ENTER with an empty line. Then no matter what I type, it just gets ignored... Here's a screenshot of my program being debugged, the frames stack and variable windows work properly and show the debug values.

The "import sys; print ..." line shows up as a tooltip when I hover over the "Python Console" message.

Thanks for any help!

/Oscar

6 comments
Comment actions Permalink

Hi! Could you please provide a code sample for reproducing the issue?

0
Comment actions Permalink

Hello!

 

It's a massive project (50+ files, quite a few external libraries used, c++ bootstrap compiled pyd modules). It basically worked with 2016.2 which I was using before, just when I switched to 2016.3.2, and tried to debug the first time the same project it didn't work any more, it got stuck with the terminal showing the prompt like ">?".

When I try with a new project with a couple of files it works fine. So I can't reproduce at a small scale to be able to send something

Is there any hing you could give me why it wold show >?, what might cause that behavior? then I could try something to see if it works again. Or maybe there's a PyCharm log that might have some error from the debugger I can look into??

Regards,

Oscar

0
Comment actions Permalink

Debug console shows ">?" when there is need to type some input to the program, i.e. the function "input()" or "raw_input()" was called. Do you have such functions in your script?
Could you please set environment variable "PYCHARM_DEBUG=True" and provide console output?

0
Comment actions Permalink

Hi Elizabeth!

 

That was the trick! There's a thread constantly reading input from the command line!

def _pipeReaderThread(self):
i = 0
while True:
# noinspection PyBroadException
try:
data = sys.stdin.readline()
i += 1

if data.strip() == PIPE_SHUTDOWN_COMMAND:
logging.info("Received shutdown command from stdin")
self.quit()
break
except:
break

When the readLine() is waiting for an input, it blocks the prompt with the >?.

For the moment I've worked around the issue by detecting if the process is running with pydevd and skip that thread from being started.

It would be nice to have the option of using the interative console even if the program was waiting for an input. But now that I know what;s happening, it's not that big a deal anymore!

Thanks for the info!

0
Comment actions Permalink

I don't have any loop and this problem exists. I just run the simple command 

>>> name=input("enter your name")
enter your name>? 3232324
>? sadfasdf
>? dasfasdf
>? asdfasdfsa
>? asdfa

Is there any shortkey to break?

 

0
Comment actions Permalink

Hi! We fixed this problem in PyCharm 2017.3.3 update: https://youtrack.jetbrains.com/issue/PY-27881

0

Please sign in to leave a comment.