Clarify decode_unicode behaviour in iter_{content,lines} docstrings (#7365)

This commit is contained in:
Chris Riches
2026-04-15 16:06:46 +01:00
committed by GitHub
parent a044b020de
commit d2f6bdecc8

View File

@@ -811,8 +811,10 @@ class Response:
chunks are received. If stream=False, data is returned as
a single chunk.
If decode_unicode is True, content will be decoded using the best
available encoding based on the response.
If decode_unicode is True, content will be decoded using encoding
information from the response. If no encoding information is available,
bytes will be returned. This can be bypassed by manually setting
`encoding` on the response.
"""
def generate():
@@ -863,6 +865,9 @@ class Response:
stream=True is set on the request, this avoids reading the
content at once into memory for large responses.
The decode_unicode param works the same as in `iter_content`, with the
same caveats.
.. note:: This method is not reentrant safe.
"""