Fwd: Re: Debugging WSGI apps, WAS Re: [wingide-users] Debugging Paste/Pylons apps with ver 3.0a2

Pete pfein at pobox.com
Mon May 21 09:48:44 MDT 2007

Ian's the author of Paste. I don't think his message got through b/c he's not 
on the list. HTH


----------  Forwarded Message  ----------

Subject: Re: Debugging WSGI apps, WAS Re: [wingide-users] Debugging 
Paste/Pylons apps with ver 3.0a2
Date: Monday May 21 2007 10:32 am
From: Ian Bicking <ianb at colorstudy.com>
To: Pete <pfein at pobox.com>
Cc: wingide-users at wingware.com

Pete wrote:
> On Sunday May 20 2007 9:56 pm, Christopher Baus wrote:
>> I'm trying to get the new threaded debugger to work with paste server and
>> pylons.
>> I wrote a little wrapper script to start the server.
>> from paste.script.serve import ServeCommand
>> myserver = ServeCommand("serve")
>> myserver.run(["--reload", "development.ini"])
>> But the debugger never seems to hit my breakpoints.  What do I have to do
>> to debug paste applications?

I don't know why it's not working.  Usually it's something with stdout
being redirected; but as long as you aren't using anything that
redirects stdout (including the --log-file option to paster, or the
printdebug middleware) it should be fine.  I think I've used pdb like
that myself.

> Dunno about Paste/Pylons, but I've found using wsgiref[0] as a server works
> reasonably well - it's single threaded & based on standard library's
> SocketServer.  You'll probably also want to disable/minimize any
> debugging/uncaught exception handling (the option that gives you a
> traceback in your browser) when running under Wing, as they tend to
> interfere with each other.

It's possible that wsgiref will be less intrusive when it comes to pdb;
I don't think there's a Paste Deploy entry point for it, though.  The
CherryPy server in particular might cause problems; I don't think
Paste's HTTP server does any stdout redirection.

If you are using Pylons (or Paste's evalexception/evalerror middleware)
then I often put in "assert 0" somewhere to see what's weird.  Then you
can inspect the environment at that point.  But unlike pdb you can't
continue from that point.

Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org

             | Write code, do good | http://topp.openplans.org/careers


Peter Fein   ||   773-575-0694   ||   pfein at pobox.com
http://www.pobox.com/~pfein/   ||   PGP: 0xCCF6AE6B
irc: pfein at freenode.net   ||   jabber: peter.fein at gmail.com

More information about the wingide-users mailing list