Ticket #2745: django-3764-error_reporting_error.diff.txt

File django-3764-error_reporting_error.diff.txt, 1.1 KB (added by md@…, 18 years ago)
Line 
1Index: django/core/handlers/modpython.py
2===================================================================
3--- django/core/handlers/modpython.py (revision 3764)
4+++ django/core/handlers/modpython.py (working copy)
5@@ -16,9 +16,25 @@
6 self.path = req.uri
7
8 def __repr__(self):
9+ try:
10+ get = pformat(self.GET)
11+ except:
12+ get = '<internal error>'
13+ try:
14+ post = pformat(self.POST)
15+ except:
16+ post = '<internal error>'
17+ try:
18+ cookies = pformat(self.COOKIES)
19+ except:
20+ cookies = '<internal error>'
21+ try:
22+ meta = pformat(self.META)
23+ except:
24+ meta = '<internal error>'
25+
26 return '<ModPythonRequest\npath:%s,\nGET:%s,\nPOST:%s,\nCOOKIES:%s,\nMETA:%s>' % \
27- (self.path, pformat(self.GET), pformat(self.POST), pformat(self.COOKIES),
28- pformat(self.META))
29+ (self.path, get, post, cookies, meta)
30
31 def get_full_path(self):
32 return '%s%s' % (self.path, self._req.args and ('?' + self._req.args) or '')
Back to Top