[svn r140] Fixed wsgi.py to capitalize headers, fixed printing of ConnectionError exceptions when raised by FileScheme, cleaned up merge messup in coros.

This commit is contained in:
which.linden
2008-07-25 21:07:45 -07:00
parent cede6b456b
commit ba53fe116a
2 changed files with 12 additions and 5 deletions

View File

@@ -257,10 +257,14 @@ class ConnectionError(Exception):
return time.time() > expires
def __repr__(self):
response = self.params.response
return "%s(url=%r, method=%r, status=%r, reason=%r, body=%r)" % (
self.__class__.__name__, self.params.url, self.params.method,
response.status, response.reason, self.params.body)
try:
response = self.params.response
return "%s(url=%r, method=%r, status=%r, reason=%r, body=%r)" % (
self.__class__.__name__, self.params.url, self.params.method,
response.status, response.reason, self.params.body)
except AttributeError:
return "%s(url=%r, method=%r)" % (
self.__class__.__name__, self.params.url, self.params.method)
__str__ = __repr__

View File

@@ -190,7 +190,10 @@ class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
# Avoid dangling circular ref
exc_info = None
headers_set[:] = [status, response_headers]
capitalized_headers = [('-'.join([x.capitalize() for x in key.split('-')]), value)
for key, value in response_headers]
headers_set[:] = [status, capitalized_headers]
return write
try: