From c35501a1280e02638c0e5bf2530cb48e15a68ad0 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 14 Aug 2012 16:15:39 +0200 Subject: [PATCH] [py3] Fixed HttpResponse when initialized with bytes --- django/http/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/http/__init__.py b/django/http/__init__.py index 62415da3c6..930e84cddc 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -676,7 +676,7 @@ class HttpResponse(object): return b''.join([smart_bytes(e, self._charset) for e in self._container]) def _set_content(self, value): - if hasattr(value, '__iter__') and not isinstance(value, six.string_types): + if hasattr(value, '__iter__') and not isinstance(value, (bytes, six.string_types)): self._container = value self._base_content_is_iter = True else: