Anonymous avatar Anonymous committed 1ad7cc9

[soc2009/http-wsgi-improvements] Add docs that I missed from the patch and reformat HttpResponse.__str__. refs #6527

This and the previous revision on this branch appear to complete all the changes from #6527.

Comments (0)

Files changed (1)


         if not content_type:
             content_type = "%s; charset=%s" % (settings.DEFAULT_CONTENT_TYPE,
+        # Expects content to be an iterable container or a string.
         self._container = [''.join(content)]
         if hasattr(content, 'close'):
     def __str__(self):
         """Full HTTP message, including headers."""
-        headers = ['%s: %s' % (k, v) for k, v in self._headers.values()]
-        return '\n'.join(headers) + '\n\n' + self.content
+        return '\n'.join(['%s: %s' % (k, v) for k, v in self._headers.values()]) \
+               + "\n\n" + self.content
     def _convert_to_ascii(self, *values):
         """Converts all values to ascii strings."""
         return str(chunk)
     def close(self):
-        "No-op that remains for backwards compatibility. Ref #6527"
+        "No-op. Remains for backwards compatibility. Refs #6527"
     # The remaining methods partially implement the file-like object interface.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.