From fa1a0532d35ee5ff342c19821ad290ad48771aa4 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Tue, 29 May 2007 10:20:10 +0000 Subject: [PATCH] unicode: Changed header construction for WSGI servers so that we only send string types (not unicode that is coercable to ASII). Fixes a PEP 333 violation. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5378 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/handlers/wsgi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py index 04c39834d1..49938e25dc 100644 --- a/django/core/handlers/wsgi.py +++ b/django/core/handlers/wsgi.py @@ -200,8 +200,8 @@ class WSGIHandler(BaseHandler): except KeyError: status_text = 'UNKNOWN STATUS CODE' status = '%s %s' % (response.status_code, status_text) - response_headers = response.headers.items() + response_headers = [(str(k), str(v)) for k, v in response.headers.items()] for c in response.cookies.values(): - response_headers.append(('Set-Cookie', c.output(header=''))) + response_headers.append(('Set-Cookie', str(c.output(header='')))) start_response(status, response_headers) return response