Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Debugging with pdb hangs on Windows
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
booltype  
View profile  
 More options Feb 1 2012, 12:18 am
From: booltype <sawall...@gmail.com>
Date: Tue, 31 Jan 2012 21:18:08 -0800 (PST)
Local: Wed, Feb 1 2012 12:18 am
Subject: Debugging with pdb hangs on Windows
Hi,
I am having troubles getting pdf interactive debugging to work on a
Django project I have to support, running on Windows.

I can start httpd.exe -X from the command line with the standard setup
ok, but if I try to wrap the application in Debugger() a reload of the
page hangs and times out. No change at the command line (i.e. PDB
showing).

One thing I noticed is that I cannot stop httpd.exe with CTRL-C at the
command line and have to close cmd.exe directly - not sure if that is
relevant.

Is the wrapped call as I did even possible with Django? Or any
pointers as to how to get this running?

Thanks
Stefan

Software versions:
==================
- Windows XP SP3
- Apache 2.2.1 (apache.org download)
- mod_wsgi 3.3 (binary download from mod_wsgi home)
- Python 2.7.2 (from python.org)

mod_wsgi configuration
======================
As far as I can tell mod_wsgi is not configured further in the Apache
conf files (just a LoadModule), running in embedded mode (verified as
described in http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode)

django.wsgi
===========

import os, sys

class Debugger:

    def __init__(self, object):
        self.__object = object

    def __call__(self, *args, **kwargs):
        import pdb, sys
        debugger = pdb.Pdb()
        debugger.use_rawinput = 0
        debugger.reset()
        sys.settrace(debugger.trace_dispatch)

        try:
            return self.__object(*args, **kwargs)
        finally:
            debugger.quitting = 1
            sys.settrace(None)

#Calculate the path based on the location of the WSGI script.
apache_configuration= os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)

#Add the path to 3rd party django application and to django itself.
sys.path.append('d:\\project')
sys.path.append('d:\\project\\python27\\Lib\\site-packages\\django')
sys.path.append('d:\\project\\python27\\Lib\\site-packages\\django')

os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
import django.core.handlers.wsgi
application = Debugger(django.core.handlers.wsgi.WSGIHandler())


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Graham Dumpleton  
View profile  
 More options Feb 1 2012, 8:32 pm
From: Graham Dumpleton <graham.dumple...@gmail.com>
Date: Thu, 2 Feb 2012 12:32:42 +1100
Local: Wed, Feb 1 2012 8:32 pm
Subject: Re: [modwsgi] Debugging with pdb hangs on Windows

That recipe was only ever tested on UNIX systems. I wouldn't be surprised
if it didn't work on Windows. It may be necessary to use a more capable
debugger such as that in Komodo IDE which allows remote debugging of
process without needing to start Apache in that funny way.

Hard for me to suggest much else right now. If you have a specific issue
with code that might be caused by running under mod_wsgi then you could
always explain it as can see if know about issue already.

Graham

modwsgi+unsubscribe@googlegroups.com.
> For more options, visit this group at

http://groups.google.com/group/modwsgi?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »