Django

Code

Changeset 4098

Show
Ignore:
Timestamp:
11/24/06 12:24:34 (2 years ago)
Author:
ubernostrum
Message:

0.91-bugfixes: Backport [3820] to 0.91-bugfixes, refs #2745.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/0.91-bugfixes/django/core/handlers/modpython.py

    r3725 r4098  
    1414 
    1515    def __repr__(self): 
     16        # Since this is called as part of error handling, we need to be very 
     17        # robust against potentially malformed input. 
     18        try: 
     19            get = pformat(self.GET) 
     20        except: 
     21            get = '<could not parse>' 
     22        try: 
     23            post = pformat(self.POST) 
     24        except: 
     25            post = '<could not parse>' 
     26        try: 
     27            cookies = pformat(self.COOKIES) 
     28        except: 
     29            cookies = '<could not parse>' 
     30        try: 
     31            meta = pformat(self.META) 
     32        except: 
     33            meta = '<could not parse>' 
     34        try: 
     35            user = self.user 
     36        except: 
     37            user = '<could not parse>' 
    1638        return '<ModPythonRequest\npath:%s,\nGET:%s,\nPOST:%s,\nCOOKIES:%s,\nMETA:%s,\nuser:%s>' % \ 
    17             (self.path, pformat(self.GET), pformat(self.POST), pformat(self.COOKIES), 
    18             pformat(self.META), pformat(self.user)) 
     39               (self.path, get, post, cookies, meta, user) 
    1940 
    2041    def get_full_path(self):