diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-05-19 17:43:34 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-05-19 17:43:34 +0200 |
| commit | 38408f8007eae21b9f1cbbcc7f86d4b2042ff86a (patch) | |
| tree | 16cc42e7033bd03077f51ac6868569968e3bc14c /django/http/__init__.py | |
| parent | 822d6d6dabc959532fb2904376580e8947c519f6 (diff) | |
Marked bytestrings with b prefix. Refs #18269
This is a preparation for unicode literals general usage in
Django (Python 3 compatibility).
Diffstat (limited to 'django/http/__init__.py')
| -rw-r--r-- | django/http/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py index 2bad146010..bf848deb38 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -18,7 +18,7 @@ _cookie_encodes_correctly = Cookie.SimpleCookie().value_encode(';') == (';', '"\ # See ticket #13007, http://bugs.python.org/issue2193 and http://trac.edgewall.org/ticket/2256 _tc = Cookie.SimpleCookie() try: - _tc.load('foo:bar=1') + _tc.load(b'foo:bar=1') _cookie_allows_colon_in_names = True except Cookie.CookieError: _cookie_allows_colon_in_names = False @@ -650,8 +650,8 @@ class HttpResponse(object): def _get_content(self): if self.has_header('Content-Encoding'): - return ''.join([str(e) for e in self._container]) - return ''.join([smart_str(e, self._charset) for e in self._container]) + return b''.join([str(e) for e in self._container]) + return b''.join([smart_str(e, self._charset) for e in self._container]) def _set_content(self, value): if hasattr(value, '__iter__'): |
