Archaeopteryx Software, Inc.
Take Flight!Search

Wing IDE
About Us
Open Source

 Advanced Search

[wingide-users] Debugging Zope's FTP server with WingIDE

Stephan R.A. Deibel sdeibel at
Thu, 26 Sep 2002 11:20:57 -0400 (EDT)

On Thu, 26 Sep 2002, Andreas Jung wrote:
> Well, I have been a member of the Zope coreteam and I have been
> on the FTP server stuff of Zope a lot. So I am curious if WingIDE
> could have done my life more easier ;-)

Yes, Wing can debug Zope itself.  The approach is somewhat different than
debugging client code and there is the caveat that you need to set up Zope
to be single threaded during debugging to avoid unpredictable stopping on
breakpoints/exceptions (only one thread in the thread pool will be

Here are the basic steps:

1) Install Zope + Wing

2) Copy from the Wing installation into your Zope code

3) Edit your code to add 'import wingdbstub' somewhere before the code
   you want to debug.

4) Zope needs to run with the -t 0 option, e.g. with a 'start' script
   like this:

#! /bin/sh
reldir=`dirname $0`
ZOPEHOME=`cd $reldir; pwd`
exec $ZOPEHOME/bin/python $ZOPEHOME/ -D "$@" -Z '' -t 0

5) Run Wing and make sure that Enable Passive Listen was selected
   from the Run / Network Mode menu area (or set preference
   debug.passive-listen=true in your preferences file, which is
   accessible from the Edit menu; then restart Wing IDE).  Either
   way the status area at the top of windows should read
   "Debugger: Ready and Listening".

6) Launch Zope and execute the code that does the 'import wingdbstub'.
   This should cause Wing to change to "Debugger: Program Running"
   or may reach an exception or breakpoint if you've set one.

7) It's possible you will also need to make a modification to
   ZServer/PubCore/ so that the handle() method
   reads as follows:

    def handle(self, name, request, response):
        import ZPublisher
            ZPublisher.publish_module(name, request = request, response = response)

   This was needed in the past but our recent threading-related
   improvements may mean this is no longer required.

The above assumes you're running Zope and Wing IDE as the same
user on the same machine.  If you want to do remote debugging,
this is described in the Debugger chapter of the manual:

(see section 6.15.3)

Please let us know if you run into any problems.


- Stephan

Run by Mailman v 2.0.8

Copyright (c) 2000-2002, Archaeopteryx Software, Inc.
Legal Statements