Django

Code

Changeset 5378

Show
Ignore:
Timestamp:
05/29/07 05:20:10 (2 years ago)
Author:
mtredinnick
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode/django/core/handlers/wsgi.py

    r5342 r5378  
    201201            status_text = 'UNKNOWN STATUS CODE' 
    202202        status = '%s %s' % (response.status_code, status_text) 
    203         response_headers = response.headers.items() 
     203        response_headers = [(str(k), str(v)) for k, v in response.headers.items()] 
    204204        for c in response.cookies.values(): 
    205             response_headers.append(('Set-Cookie', c.output(header=''))) 
     205            response_headers.append(('Set-Cookie', str(c.output(header='')))) 
    206206        start_response(status, response_headers) 
    207207        return response