diff options
| author | Justin Bronn <jbronn@gmail.com> | 2007-08-26 01:10:53 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2007-08-26 01:10:53 +0000 |
| commit | 2052b508eb92c62fc0678efd4936c5ec1e0e735b (patch) | |
| tree | e510109b74b28c8ccef5f6955727cb9dce3da655 /django/core/handlers/modpython.py | |
| parent | a7297a255f4bb86f608ea251e00253d18c31d9d4 (diff) | |
gis: Made necessary modifications for unicode, manage refactor, backend refactor and merged 5584-6000 via svnmerge from [repos:django/trunk trunk].
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6018 bcc190cf-cafb-0310-a4f2-bffc1f526a37
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 |
