backend/wsgi/wsgiRequest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit 7606e03e7626b4a3cf210e7f6577455fbbca9fce Author: Jan Pazdziora jpazdziora@redhat.com Date: Tue Apr 17 10:49:50 2012 +0200
The mod_wsgi insists on having something after the numeric value on the Status line.
Addressing File "/usr/lib/python2.4/site-packages/spacewalk/server/apacheRequest.py", line 368, in response self.req.send_http_header() File "/usr/share/rhn/wsgi/wsgiRequest.py", line 80, in send_http_header self.start_response(self.status, self.headers_out.items()) ValueError: status message was not supplied
diff --git a/backend/wsgi/wsgiRequest.py b/backend/wsgi/wsgiRequest.py index df5c0a9..b8d4268 100644 --- a/backend/wsgi/wsgiRequest.py +++ b/backend/wsgi/wsgiRequest.py @@ -68,8 +68,11 @@ class WsgiRequest: self.headers_out.add(i[0], i[1])
if hasattr(httplib, "responses"): - # httplib in 2.4 did not have the responses dictionary self.status = self.status + " " + httplib.responses[int(self.status)] + else: + # httplib in 2.4 did not have the responses dictionary + # and mod_wsgi insists on having something after the numeric value + self.status = self.status + " Status " + self.status
if len(self.content_type) > 0: self.headers_out['Content-Type'] = self.content_type
commit 5a0f7800223db43eca040017e142346be60796dd Author: Jan Pazdziora jpazdziora@redhat.com Date: Tue Apr 17 10:09:29 2012 +0200
Workaround httplib in 2.4 which did not have the responses dictionary.
Addressing File "/usr/lib/python2.4/site-packages/spacewalk/server/apacheRequest.py", line 368, in response self.req.send_http_header() File "/usr/share/rhn/wsgi/wsgiRequest.py", line 70, in send_http_header self.status = self.status + " " + httplib.responses[int(self.status)] AttributeError: 'module' object has no attribute 'responses'
diff --git a/backend/wsgi/wsgiRequest.py b/backend/wsgi/wsgiRequest.py index 140192f..df5c0a9 100644 --- a/backend/wsgi/wsgiRequest.py +++ b/backend/wsgi/wsgiRequest.py @@ -67,7 +67,9 @@ class WsgiRequest: for i in self.err_headers_out.items(): self.headers_out.add(i[0], i[1])
- self.status = self.status + " " + httplib.responses[int(self.status)] + if hasattr(httplib, "responses"): + # httplib in 2.4 did not have the responses dictionary + self.status = self.status + " " + httplib.responses[int(self.status)]
if len(self.content_type) > 0: self.headers_out['Content-Type'] = self.content_type
spacewalk-commits@lists.fedorahosted.org