diff options
Diffstat (limited to 'django/core/handlers/modpython.py')
| -rw-r--r-- | django/core/handlers/modpython.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py index 6370cab47c..7c4bbb3082 100644 --- a/django/core/handlers/modpython.py +++ b/django/core/handlers/modpython.py @@ -2,6 +2,7 @@ from django.core.handlers.base import BaseHandler from django.core import signals from django.dispatch import dispatcher from django.utils import datastructures +from django.utils.encoding import force_unicode from django import http from pprint import pformat import os @@ -13,7 +14,7 @@ import os class ModPythonRequest(http.HttpRequest): def __init__(self, req): self._req = req - self.path = req.uri + self.path = force_unicode(req.uri) def __repr__(self): # Since this is called as part of error handling, we need to be very @@ -49,7 +50,7 @@ class ModPythonRequest(http.HttpRequest): if 'content-type' in self._req.headers_in and self._req.headers_in['content-type'].startswith('multipart'): self._post, self._files = http.parse_file_upload(self._req.headers_in, self.raw_post_data) else: - self._post, self._files = http.QueryDict(self.raw_post_data), datastructures.MultiValueDict() + self._post, self._files = http.QueryDict(self.raw_post_data, encoding=self._encoding), datastructures.MultiValueDict() def _get_request(self): if not hasattr(self, '_request'): @@ -58,7 +59,7 @@ class ModPythonRequest(http.HttpRequest): def _get_get(self): if not hasattr(self, '_get'): - self._get = http.QueryDict(self._req.args) + self._get = http.QueryDict(self._req.args, encoding=self._encoding) return self._get def _set_get(self, get): @@ -160,7 +161,7 @@ class ModPythonHandler(BaseHandler): req.content_type = response['Content-Type'] for key, value in response.headers.items(): if key != 'Content-Type': - req.headers_out[key] = value + req.headers_out[str(key)] = str(value) for c in response.cookies.values(): req.headers_out.add('Set-Cookie', c.output(header='')) req.status = response.status_code |
