diff options
| author | Jason Pellerin <jpellerin@gmail.com> | 2006-11-29 20:11:43 +0000 |
|---|---|---|
| committer | Jason Pellerin <jpellerin@gmail.com> | 2006-11-29 20:11:43 +0000 |
| commit | 9a01534370a272e59f2bb64251d1f46218a32516 (patch) | |
| tree | 1d0dcb7b5985f555a422f075eeffce14128dec29 /django/core/handlers/modpython.py | |
| parent | 08fe1b64afbb237e4e6c74bf22be80f2b7f3977e (diff) | |
[multi-db] Merge trunk to [3825]. Some tests still failing. (previous commit was from tests/ dir only)
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@4141 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/handlers/modpython.py')
| -rw-r--r-- | django/core/handlers/modpython.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py index db3c33147b..41d9a578c5 100644 --- a/django/core/handlers/modpython.py +++ b/django/core/handlers/modpython.py @@ -16,9 +16,26 @@ class ModPythonRequest(http.HttpRequest): self.path = req.uri def __repr__(self): + # Since this is called as part of error handling, we need to be very + # robust against potentially malformed input. + try: + get = pformat(self.GET) + except: + get = '<could not parse>' + try: + post = pformat(self.POST) + except: + post = '<could not parse>' + try: + cookies = pformat(self.COOKIES) + except: + cookies = '<could not parse>' + try: + meta = pformat(self.META) + except: + meta = '<could not parse>' return '<ModPythonRequest\npath:%s,\nGET:%s,\nPOST:%s,\nCOOKIES:%s,\nMETA:%s>' % \ - (self.path, pformat(self.GET), pformat(self.POST), pformat(self.COOKIES), - pformat(self.META)) + (self.path, get, post, cookies, meta) def get_full_path(self): return '%s%s' % (self.path, self._req.args and ('?' + self._req.args) or '') |
