Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

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

comment:1 by Lincoln, 4 years ago

Description: modified (diff)

comment:2 by Mariusz Felisiak, 4 years ago

Easy pickings: set
Summary: StreamingHttpResponse docs incorrectly specifies stringsStreamingHttpResponse docs incorrectly specifies strings.
Triage Stage: UnreviewedAccepted

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?

comment:4 by Lincoln, 4 years ago

Has patch: set
Owner: changed from nobody to Lincoln
Status: newassigned

comment:5 by GitHub <noreply@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In d7543610:

Fixed #31816 -- Corrected the expected content type in StreamingHttpResponse docs.

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In bc75442e:

[3.1.x] Fixed #31816 -- Corrected the expected content type in StreamingHttpResponse docs.

Backport of d75436109694c286d9af48ae94ca39759d080214 from master

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 6fc4445c:

[3.0.x] Fixed #31816 -- Corrected the expected content type in StreamingHttpResponse docs.

Backport of d75436109694c286d9af48ae94ca39759d080214 from master

Note: See TracTickets for help on using tickets.
Back to Top