Opened 18 years ago
Closed 18 years ago
#3437 closed (fixed)
djang.http.HttpResponse logic for _is_string is invalid
Description (last modified by ) ¶
code currently does effectively thus-
if hasattr(content, '__iter__'): self._is_string = False self._container = content else: self._is_string = True self._container = [content]
Problem is that string objects support iteration.
Fix for it's simple; just do
if not isinstance(content, basestring) and hasattr(content, '__iter__'):
(yes y'all prefer seperate patches, but it's a one liner ;)
Change History (3)
comment:1 by , 18 years ago
comment:3 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
pardon the bugspam; forgot about wikiformatting, adding the properly formatted snippet...