#31816 closed Cleanup/optimization (fixed)
StreamingHttpResponse docs incorrectly specifies strings.
| Reported by: | Lincoln | Owned by: | Lincoln |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
In the docs for StreamingHttpResponse https://docs.djangoproject.com/en/dev/ref/request-response/#streaminghttpresponse-objects
It says that "It should be given an iterator that yields strings as content."
But in the class there is
def getvalue(self):
return b''.join(self.streaming_content)
So I think the docs should specify that it be given an iterator of bytestrings instead.
That line of the docs hasn't changed since 2012 when it was added. I suspect that back then "strings" meant python2 strings.
Change History (7)
comment:1 by , 5 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 5 years ago
| Easy pickings: | set |
|---|---|
| Summary: | StreamingHttpResponse docs incorrectly specifies strings → StreamingHttpResponse docs incorrectly specifies strings. |
| Triage Stage: | Unreviewed → Accepted |
comment:4 by , 5 years ago
| Has patch: | set |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.
Agreed, there is a typo, "It should be given an iterator that yields bytestrings as content." is a correct form. Would you like to provide a patch?