can't debug when using cmd readline and command completion

I'm trying to debug a program based on the Python cmd module, which uses readline for command completion.  When I run it in the Pycharm debugger, cmd acts as if raw input is disabled, and takes input only after a <CR> is pressed.  So the command completion code is not called, defeating my purpose.  This happens even if I run remote debug on my program.  Any ideas how to make this work?
4 comments
BTW, I'm running the test on a Mac, OSX 10.7.5, Python 2.6.6, PyCharm 2.7.2
0
As far as I understand, readline works only in a real terminal. The output console that you get in PyCharm (and presumably in any other Python IDE) is not a real terminal.

Remote debug should work as long as you launch your program from a terminal and not from PyCharm.
0
OK, thanks for the tip.  I was using a terminal with remote debug, but I also had to change my settrace() arguments.  This works:

        pydevd.settrace(debug_host, port=8888, suspend=False,
         stdoutToServer=False, stderrToServer=False)

Whereas before my std*ToServer values were True.  Maybe output handling also affects input handling.
0
Thanks, that helped!  I posted the details to your forum.

Regards,

George
0

Please sign in to leave a comment.