Ticket #11111: ticket_11111.diff

File ticket_11111.diff, 1.1 KB (added by Jeff Buttars <jeffbuttars@…>, 13 years ago)

Diff for core/handlers/wsgi.py for unicode problem in wsgi handling

  • django/core/handlers/wsgi.py

    diff -r f4cee4125170 django/core/handlers/wsgi.py
    a b  
    126126
    127127class WSGIRequest(http.HttpRequest):
    128128    def __init__(self, environ):
    129         script_name = base.get_script_name(environ)
    130         path_info = force_unicode(environ.get('PATH_INFO', u'/'))
     129        script_name = base.get_script_name(environ).decode('latin-1')
     130        path_info = environ.get('PATH_INFO', '/').decode('latin-1')
    131131        if not path_info or path_info == script_name:
    132132            # Sometimes PATH_INFO exists, but is empty (e.g. accessing
    133133            # the SCRIPT_NAME URL without a trailing slash). We really need to
     
    136136            #
    137137            # (The comparison of path_info to script_name is to work around an
    138138            # apparent bug in flup 1.0.1. Se Django ticket #8490).
    139             path_info = u'/'
     139            path_info = '/'.decode('latin-1')
    140140        self.environ = environ
    141141        self.path_info = path_info
    142142        self.path = '%s%s' % (script_name, path_info)
Back to Top