Opened 4 years ago

Last modified 4 years ago

#31816 closed Cleanup/optimization

StreamingHttpResponse docs incorrectly specifies strings — at Version 1

Reported by: Lincoln Owned by: nobody
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 Lincoln)

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 (1)

comment:1 by Lincoln, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top