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

Thomas Mulvany tmulvany at sbcglobal.net
Fri Mar 8 20:16:23 EST 2013


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?

Appreciate anything you can come up with.  Cheers.

The Thumbs Guy

--------------------------------------------------------------------------------------------------------------------------


Mac OS X 10.8.2, Python 2.7.2, Apache 2.2.22, Wing (Professional) 4.1.7-1 (rev 
26991), Firefox 19.0.2



--------------------------------------------------------------------------------
STARTING NEW DEBUG LOGGING SESSION
--------------------------------------------------------------------------------
wingdbg - 2013/03/08 16:37:09 - 'netserver CLOSECHANNEL' 
wingdbg - 2013/03/08 16:37:09 - 'Bound attach listener to port' 50015 
wingdbg - 2013/03/08 16:37:09 - '******************** START DEBUG 
************************' 

wingdbg - 2013/03/08 16:37:09 - 'ABOUT TO INIT' 
wingdbg - 2013/03/08 16:37:09 - 'SET UP C CORE' 
wingdbg - 2013/03/08 16:37:09 - 'RESET' 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'abstract' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/abstract.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/abstract.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'constants' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/constants.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/constants.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'dbgserver' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/dbgserver.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/dbgserver.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'dbgutils' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/dbgutils.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/dbgutils.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'_extensions' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_extensions.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_extensions.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'findmodules' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/findmodules.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/findmodules.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'netserver' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/netserver.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/netserver.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'channel' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/channel.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/channel.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'dbginspect' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/dbginspect.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/dbginspect.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'_django' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_django.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_django.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'_matplotlib' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_matplotlib.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_matplotlib.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'py2utils' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/py2utils.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/py2utils.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'_gtkhooks' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_gtkhooks.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_gtkhooks.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'_zopehooks' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_zopehooks.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_zopehooks.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'_tkinterhooks' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_tkinterhooks.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_tkinterhooks.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'_wxhooks' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_wxhooks.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_wxhooks.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'Registering internal module: ' <module 
'_wx25hooks' from 
'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_wx25hooks.pyc'>
 '; ' 
"'/Applications/WingIDE.app/Contents/MacOS/bin/2.7/src/debug/tserver/_wx25hooks.py'"
 
wingdbg - 2013/03/08 16:37:09 - 'setting __fClient to' <netserver.CNetworkServer 
instance at 0x10bc449e0> 

wingdbg - 2013/03/08 16:37:09 - 'RESET' 
wingdbg - 2013/03/08 16:37:09 - 'Connecting to client...' 
wingdbg - 2013/03/08 16:37:09 - 'Could not connect to debug client' 
wingdbg - 2013/03/08 16:37:09 - 'Runtime failure details:' 
wingdbg - 2013/03/08 16:37:09 - "Exception: <class 'socket.error'>" 
wingdbg - 2013/03/08 16:37:09 - 'Value = [Errno 61] Connection refused' 
wingdbg - 2013/03/08 16:37:09 - 'Traceback (innermost last):' 
wingdbg - 2013/03/08 16:37:09 - '  File "2.7/src/debug/tserver/netserver.pyc", 
line 1440, in __ConnectToClient\n' 

wingdbg - 2013/03/08 16:37:09 - '  File "2.7/src/debug/tserver/channel.pyc", 
line 322, in Connect\n' 

wingdbg - 2013/03/08 16:37:09 - '  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
 line 224, in meth\n' 

wingdbg - 2013/03/08 16:37:09 - 'netserver CLOSECHANNEL' 
wingdbg - 2013/03/08 16:37:09 - 'Starting non-client run' 
wingdbg - 2013/03/08 16:37:09 - 'STARTING DEBUG' 
wingdbg - 2013/03/08 16:37:09 - '__CheckFloatingPointMode' 
wingdbg - 2013/03/08 16:37:09 - 'RESET' 
wingdbg - 2013/03/08 16:37:09 - '_CB_DebugThread called with thread_id =' 
140735241904512 

wingdbg - 2013/03/08 16:37:09 - '_CB_DebugThread returning' 1 
wingdbg - 2013/03/08 16:37:09 - 'CHECK FOR CONNECTION' 
wingdbg - 2013/03/08 16:37:09 - 'LISTENER INFO:' ('0.0.0.0', 50015) 
wingdbg - 2013/03/08 16:37:09 - 'SELECT RESULT' [] [] [] 
wingdbg - 2013/03/08 16:37:09 - 'CONTINUE' 
wingdbg - 2013/03/08 16:37:09 - 'CHECK FOR CONNECTION' 
wingdbg - 2013/03/08 16:37:09 - 'LISTENER INFO:' ('0.0.0.0', 50015) 
wingdbg - 2013/03/08 16:37:09 - 'SELECT RESULT' [] [] [] 
wingdbg - 2013/03/08 16:37:09 - 'USER EXCEPTION' 
wingdbg - 2013/03/08 16:37:09 - 'GeneratorExit:' 'None' 
wingdbg - 2013/03/08 16:37:09 - 'Traceback:' 
wingdbg - 2013/03/08 16:37:09 - '  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py", 
line 587, in <genexpr>' 

wingdbg - 2013/03/08 16:37:09 - '_BlockUntilReadyToRun: <frame object at 
0x7f91f16620a0>' 

wingdbg - 2013/03/08 16:37:09 - '  filename = 
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py, 
lineno = 587' 

wingdbg - 2013/03/08 16:37:09 - 'USER EXCEPTION IN BLOCKUNTILREADYTORUN' 
wingdbg - 2013/03/08 16:37:09 - 'SENDING PROGRAM STOPPED ON EXCEPTION' 
<netserver.CNetworkServer instance at 0x10bc449e0> 

wingdbg - 2013/03/08 16:37:09 - 'NETSERVER PROGRAM STOPPED' 
wingdbg - 2013/03/08 16:37:09 - 'QUIT=FALSE' 
wingdbg - 2013/03/08 16:37:09 - 'THREADS=' [(140264794516992, u'MainThread', 0)] 

wingdbg - 2013/03/08 16:37:09 - 'CURRENT THREAD=' 140264794516992 
wingdbg - 2013/03/08 16:37:09 - 'STACK =' [((u'/Users/"<My User 
Name>"/Sites/CGI_Files/TestAjax/ajaxtest.py', 26, u'    d[k] = fs.getvalue(k) + 
" in "<My User Name>"/Sites"\n', u'<module>', []), 26), 
((u'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py',
 540, u'', u'getvalue', [u'self', u'key', u'default', u'value']), 540), 
((u'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py',
 587, u'', u'__contains__', [u'self', u'key']), 587), 
((u'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py',
 587, u'', u'<genexpr>', [u'.0', u'item']), 587)] 

wingdbg - 2013/03/08 16:37:09 - 'FRAMEIDX' 3 
wingdbg - 2013/03/08 16:37:09 - 'CHECK FOR CONNECTION' 
wingdbg - 2013/03/08 16:37:09 - 'LISTENER INFO:' ('0.0.0.0', 50015) 
wingdbg - 2013/03/08 16:37:09 - 'SELECT RESULT' [] [] [] 
wingdbg - 2013/03/08 16:37:09 - 'CHECK FOR CONNECTION' 
wingdbg - 2013/03/08 16:37:09 - 'LISTENER INFO:' ('0.0.0.0', 50015) 
wingdbg - 2013/03/08 16:37:09 - 'SELECT RESULT' [] [] [] 
wingdbg - 2013/03/08 16:37:09 - 'CONTINUE' 
wingdbg - 2013/03/08 16:37:09 - 'EXITING TO RUN' 
wingdbg - 2013/03/08 16:37:09 - 'USER EXCEPTION' 
wingdbg - 2013/03/08 16:37:09 - 'GeneratorExit:' 'None' 
wingdbg - 2013/03/08 16:37:09 - 'Traceback:' 
wingdbg - 2013/03/08 16:37:09 - '  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py", 
line 587, in <genexpr>' 

wingdbg - 2013/03/08 16:37:09 - '_BlockUntilReadyToRun: <frame object at 
0x7f91f1665b70>' 

wingdbg - 2013/03/08 16:37:09 - '  filename = 
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py, 
lineno = 587' 

wingdbg - 2013/03/08 16:37:09 - 'USER EXCEPTION IN BLOCKUNTILREADYTORUN' 
wingdbg - 2013/03/08 16:37:09 - 'SENDING PROGRAM STOPPED ON EXCEPTION' 
<netserver.CNetworkServer instance at 0x10bc449e0> 

wingdbg - 2013/03/08 16:37:09 - 'NETSERVER PROGRAM STOPPED' 
wingdbg - 2013/03/08 16:37:09 - 'QUIT=FALSE' 
wingdbg - 2013/03/08 16:37:09 - 'THREADS=' [(140264794516992, u'MainThread', 0)] 

wingdbg - 2013/03/08 16:37:09 - 'CURRENT THREAD=' 140264794516992 
wingdbg - 2013/03/08 16:37:09 - 'STACK =' [((u'/Users/"<My User 
Name>"/Sites/CGI_Files/TestAjax/ajaxtest.py', 26, u'    d[k] = fs.getvalue(k) + 
" in "<My User Name>"/Sites"\n', u'<module>', []), 26), 
((u'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py',
 540, u'', u'getvalue', [u'self', u'key', u'default', u'value']), 540), 
((u'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py',
 587, u'', u'__contains__', [u'self', u'key']), 587), 
((u'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py',
 587, u'', u'<genexpr>', [u'.0', u'item']), 587)] 

wingdbg - 2013/03/08 16:37:09 - 'FRAMEIDX' 3 
wingdbg - 2013/03/08 16:37:09 - 'CHECK FOR CONNECTION' 
wingdbg - 2013/03/08 16:37:09 - 'LISTENER INFO:' ('0.0.0.0', 50015) 
wingdbg - 2013/03/08 16:37:09 - 'SELECT RESULT' [] [] [] 
wingdbg - 2013/03/08 16:37:09 - 'CHECK FOR CONNECTION' 
wingdbg - 2013/03/08 16:37:09 - 'LISTENER INFO:' ('0.0.0.0', 50015) 
wingdbg - 2013/03/08 16:37:09 - 'SELECT RESULT' [] [] [] 
wingdbg - 2013/03/08 16:37:09 - 'CONTINUE' 
wingdbg - 2013/03/08 16:37:09 - 'EXITING TO RUN' 
wingdbg - 2013/03/08 16:37:09 - 'USER EXCEPTION' 
wingdbg - 2013/03/08 16:37:09 - 'AssertionError:' 'asserting 0' 
wingdbg - 2013/03/08 16:37:09 - 'Traceback:' 
wingdbg - 2013/03/08 16:37:09 - '  File "/Users/"<My User 
Name>"/Sites/CGI_Files/TestAjax/ajaxtest.py", line 36, in <module>\n    assert 
0, "asserting 0"' 

wingdbg - 2013/03/08 16:37:09 - '_BlockUntilReadyToRun: <frame object at 
0x7f91f1473920>' 

wingdbg - 2013/03/08 16:37:09 - '  filename = /Users/"<My User 
Name>"/Sites/CGI_Files/TestAjax/ajaxtest.py, lineno = 36' 

wingdbg - 2013/03/08 16:37:09 - 'USER EXCEPTION IN BLOCKUNTILREADYTORUN' 
wingdbg - 2013/03/08 16:37:09 - 'SENDING PROGRAM STOPPED ON EXCEPTION' 
<netserver.CNetworkServer instance at 0x10bc449e0> 

wingdbg - 2013/03/08 16:37:09 - 'NETSERVER PROGRAM STOPPED' 
wingdbg - 2013/03/08 16:37:09 - 'QUIT=FALSE' 
wingdbg - 2013/03/08 16:37:09 - 'THREADS=' [(140264794516992, u'MainThread', 0)] 

wingdbg - 2013/03/08 16:37:09 - 'CURRENT THREAD=' 140264794516992 
wingdbg - 2013/03/08 16:37:09 - 'STACK =' [((u'/Users/"<My User 
Name>"/Sites/CGI_Files/TestAjax/ajaxtest.py', 36, u'assert 0, "asserting 0"\n', 
u'<module>', []), 36)] 

wingdbg - 2013/03/08 16:37:09 - 'FRAMEIDX' 0 
wingdbg - 2013/03/08 16:37:09 - 'CHECK FOR CONNECTION' 
wingdbg - 2013/03/08 16:37:09 - 'LISTENER INFO:' ('0.0.0.0', 50015) 
wingdbg - 2013/03/08 16:37:09 - 'SELECT RESULT' [] [] [] 
wingdbg - 2013/03/08 16:37:09 - 'CHECK FOR CONNECTION' 
wingdbg - 2013/03/08 16:37:09 - 'LISTENER INFO:' ('0.0.0.0', 50015) 
wingdbg - 2013/03/08 16:37:09 - 'SELECT RESULT' [] [] [] 
wingdbg - 2013/03/08 16:37:09 - 'CONTINUE' 
wingdbg - 2013/03/08 16:37:09 - 'ProgramQuit called' 
wingdbg - 2013/03/08 16:37:09 - 'STOPPING DEBUG' 
wingdbg - 2013/03/08 16:37:09 - 'RESET' 
wingdbg - 2013/03/08 16:37:09 - 'setting __fClient to' None 
wingdbg - 2013/03/08 16:37:09 - 'RESET' 
wingdbg - 2013/03/08 16:37:09 - 'netserver CLOSECHANNEL' 
wingdbg - 2013/03/08 16:37:09 - 'Closing attach listener socket' 
wingdbg - 2013/03/08 16:37:09 - 'EXITING TO RUN' 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/wingide-users/attachments/20130308/eb5d9638/attachment.html>


More information about the wingide-users mailing list