[wingide-users] Wing doesn't stop python anymore

Wingware Support support at wingware.com
Tue Jun 5 08:33:28 MDT 2007


Tom Stambaugh wrote:
> Most of my python development is server-side code, invoked as a cgi script 
> from apache. I debug on a winXP platform. I'm running python v2.5.
> 
> Suddenly, as in for the last few days, I've noticed that when I click the 
> "Stop" button in the debugger the IDE stops just as if things have been shut 
> down as expected. However, the browser screen that invoked the script stays 
> busy and a python executable continues to run in the background. I have to 
> bring up task manager and manually kill the python task in order to actually 
> stop execution. It's both annoying and dangerous, because the things I'm 
> debugging do all sorts of unpredictable things when the code is broken (as 
> it generally is when I click "stop").
> 
> Is this a bug in Wing, or have I perhaps broken my apache or system 
> configuration somehow?

If you have the Debugger / Remote/External / Kill Externally Launched
preference _on_ then Wing should kill the processing using essentially
the following win32 code:


   h_process = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
   if ( h_process == NULL ) {
     PyErr_SetString(PyExc_OSError, "Unable to terminate process");
     goto failure;
   }

   if ( TerminateProcess(h_process, exit_code) == 0 ) {
     PyErr_SetString(PyExc_OSError, "Unable to terminate process");
     goto failure;
   }

   CloseHandle(h_process);

This is different of course on Posix.

One possibility is that you're starting a subprocess and that keeps
running, or for some reason Wing can't terminate the process, which
should show the OSError raised above in the log.  This could happen
if the CGI is running as a different user, I suppose.

Hope that helps.

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com



More information about the wingide-users mailing list