how to get out of ipdb in mod_wsgi

505 views
Skip to first unread message

Danny

unread,
Sep 11, 2012, 6:54:48 PM9/11/12
to mod...@googlegroups.com
Howdy,

When I try to debug my django app (on RHEL5) I am using
/usr/sbin/apachectl -X

and put the code:
import ipdb; ipdb.set_trace()

in some place in the python code. The output redirects to the terminal and it all works great until I try to exit. I should be able to stop the httpd process just by typing CTRL-C or CTRL-D or something but none of that works. The only thing that seems to work is the series of commands
CTRL-Z
/etc/init.d/httpd stop
fg 1

This is really inelegant and awful. Is there a correct way to do this.

thanks,
Danny

Graham Dumpleton

unread,
Sep 12, 2012, 3:27:12 AM9/12/12
to mod...@googlegroups.com
Have you tried typing quit() or exit()

Interactive interpreter shells like that often even print out a message telling you to call those functions as the way to exit.

For a debugger they will often have a similar command you enter to do the same.

I can't give you a better answer than that right now as have limited Internet access and don't have pdb source code handy to tell you the command.

There are alao perhaps better ways of achieving what you want than pdb. Exactly what sort of problem are you trying to debug?

Graham
--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To view this discussion on the web visit https://groups.google.com/d/msg/modwsgi/-/T3qv87SZKHIJ.
To post to this group, send email to mod...@googlegroups.com.
To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.

Danny

unread,
Sep 12, 2012, 12:13:25 PM9/12/12
to mod...@googlegroups.com
Thanks for the response.

getting out of pdb or ipdb is easy just type "q". The problem isn't getting out of the debugger, the problem is that the apache process is not reacting to CTRL-C so the process just hangs. I would guess some process in the stack is eating the CTRL-C and it never makes its way to apache. So in short, I can get out of the debugger, it's the apache process itself that I can't quit.

Danny


Reply all
Reply to author
Forward
0 new messages