[wingide-users] 'Could not connect to debug client' error, Python CGI on Apache

Wingware Support support at wingware.com
Fri Mar 8 20:52:15 EST 2013

Thomas Mulvany wrote:
> I'm trying to use the Wing debugger to step through a Python CGI 
> program.  The Python program runs fine but Wing never stops on my 
> breakpoints.  I have imported wingdbstub and set breakpoints.  There's 
> a copy of wingdbstub and wingdebugpw in the same directory as my 
> Python script, both have permissions of 777.  I've tried it with 
> kEmbedded = 0 and =1, no difference.  I've set WINGHOME to 
> '/Applications/WingIDE.app/Contents/MacOS' in the wingdbstub file.  
> Other than that, the settings in the wingdbstub file are left at their 
> default values.  "Enable Passive Listen" is turned on.  I'm using the 
> Python that comes pre-installed with Mac OS X.
> I don't know if the Python interpreter is running with the -O option.  
> How can I find this out?
> So I bring up the Python CGI script in Wing, set breakpoints, and then 
> load the page in the browser.  The script is executed completely with 
> no breaks.  If I change the script in Wing, the change is reflected in 
> the browser on the next page load.  Contents of kLogFile is shown 
> below.  There's an assertion error toward the end from an "assert 0" I 
> put at the end of the CGI script.  It wasn't caught in the IDE.
> Any ideas?

It's not managing to connect to the IDE for some reason.  Is the value 
of the Debugger > External/Remote > Server Port preference in the IDE 
matching the port set in wingdbstub.py (default for both should be 50005)?

You might also want to quit and restart Wing in case it's confused or 
for some reason failing to listen on the port.  Sending a bug report 
from Wing's Help menu with the error log should show us if that is the case.

Also check if another instance of Wing is running and has listened on 
that port.  That prevents the second+ instance from listening on the 
same port.

Please let me know if this does not help.



Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list