[wingide-users] Setting break points in Python file launched by os.execvpe

Wingware Support support at wingware.com
Thu Mar 15 14:03:03 MDT 2012

Roger House wrote:
> I'm working with StoryText, an open source program for automated 
> testing of Python gui's.  StoryText is launched with a Python file 
> P.py as parameter, and P is run under control of StoryText so that 
> button presses, keystrokes, etc., can be recorded.  When P terminates, 
> StoryText launches a component N.py which displays a dialog for the 
> user to wrap things up.  N is launched by a call of os.execvpe.
> Unfortunately, when I run StoryText under Wing, N is failing.  The 
> dialog is displayed briefly, disappears, and N dies.  When not run 
> under Wing, everything is fine.  So I'm trying to investigate what's 
> going on in N when running under Wing.
> The problem I'm encountering is how to set breakpoints in N.  I've 
> opened N.py in Wing and set breakpoints in N.py and then run StoryText 
> under Wing.  N.py is launched via os.execvpe, runs, and terminates.  
> But the breakpoints set in it are ignored.
> I should note that N.py is not part of the Wing project.
> I would appreciate any input on how to get control of N.py under Wing.

The way to debug just a sub-process is to execute the parent process 
outside of the debugger and then use wingdbstub to debug the child 
process.  This is documented here:  

This should reveal any sort of environment issue.  If that works and 
doesn't crash N.py then it may be something failing in the debugger 
during the process spawn.  One idea would be to try sys.settrace(None) 
before anything else in N.py (after going back to the non-wingdbstub way 
of debugging).  Or, set the Debugger > Advanced > Debug Internals Log 
File preference and send us its output after N.py crashes.



Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list