How to debug python + curses? [was: RE: Applying winpdb_reborn]

pjfarley3 at earthlink.net pjfarley3 at earthlink.net
Tue Jun 1 00:38:43 EDT 2021


> -----Original Message-----
> From: Dennis Lee Bieber <wlfraed at ix.netcom.com>
> Sent: Sunday, May 30, 2021 4:32 PM
> To: python-list at python.org
> Subject: Re: How to debug python + curses? [was: RE: Applying
winpdb_reborn]
> 
> On Sun, 30 May 2021 13:26:40 -0400, <pjfarley3 at earthlink.net> declaimed
the
> following:
> 
> 	Follow-up to my prior response (which doesn't seem to have
> propagated out and back in to gmane yet).
> 
> >Does anyone here know if winpdb-reborn or any other debugger can
> >support 2-window debugging for a python script that uses the curses
> >module?  It seems to me that a 2-window debugging session is necessary
> >for a python script that uses the curses module because using curses
> >takes over the screen from which the script is started, so debugging
> >output and script output need to be in separate windows.
> >
> 
> 	The winpdb executable itself (with a .py as argument) was doing
> NOTHING on my system. Running the winpdb.py file (again with a .py as
> argument) instead did open a graphical user interface, AND it opened a new
> console window... But that is as far as it went. The winpdb GUI status
reported
> that it could not find the script (even if I specified a full path to it).
> 
> 	The File/Launch behaved the same way -- opened a console for the
> selected .py, but did not run it...
<Snipped> 

Thank you Dennis. I think I remember having the same issue.  From
examination of the session_manager.py code at the winpdb_reborn github repo
it would appear that the RPDBTERM environment variable needs to be defined
on a Windows system at a global level with the value "nt" to get the correct
osSpawn dictionary entry to start a new Windows console window.  And there
may be more that needs to be done to ensure that starting a new CMD.EXE
console window gets you into the correct directory.  There may need to be
additional CMD.EXE options passed into the osSpawn value to get to that
working directory where you are actually debugging.  Although I do also see
code in that same module that *looks" like it should do that job, but it may
or may not be working right for a Windows system.

I may try winpdb_reborn again using RPDBTERM=nt.  Thanks for the several
replies, appreciated.

Peter



More information about the Python-list mailing list