Console input has stopped working in debugger

Hello,

I have an application that takes input from stdin with raw_input. This has stopped working in the PyCharm debugger. It still works fine when I run within PyCharm,

When debugging within PyCharm, it used to work in exactly the same way, but now I get an extra newline before the cursor:

and if I type a number and return, I get a popup message saying "Pause the process to use the command-line". raw_input never returns.

I've recently upgraded from Community 2019.<something> to 2020.1 - I don't know if that's relevant, but I can't think of anything else that's changed in this area.

Python 2.7, Windows 8.1 Pro.

Very grateful for any ideas!

Thanks,

Cormac.

3
5 comments

Hi,

Could you provide a code sample?

0
Avatar
Permanently deleted user

Well, I tried to get a stripped-down version to do the same thing, but of course that works fine, so here's the full proc...

 

def user_option(options, prompt="Option: ", includeExitOption=False):

optionNames = sorted(options.keys())
finished = False
while not finished:
for i in range(0,len(options)):
output(str(i+1)+': ' + optionNames[i])
if includeExitOption:
output(str(len(options)+1)+': Exit')
try:
index = int(input(prompt))
except:
index = 0 # invalid option reported below
if index > 0 and index <= len(options):
optionName = optionNames[index-1]
finished = True
elif index == len(options)+1 and includeExitOption:
optionName = '__EXIT'
finished = True
else:
output('Invalid option\n')

return optionName

Thanks for any help!

0

Hi, the example cannot be executed - it has unresolved references, and lacks the function call.

Unfortunately I could not intentionally reproduce the issue you originally described, so if you could provide a minimal working example and steps to reproduce, that would help.

0
Avatar
Permanently deleted user

I'll try to do that, thanks!

0
Avatar
Permanently deleted user

I'm having this same issue but on IntelliJ Ultimate. Using the scanner object in Java, it works fine under run but in debug, no input is ever sent to the program.

 

Edit: After pausing and resuming output, functionality seems to have been restored. 

0

Please sign in to leave a comment.