Martin Panter <vadmium...@gmail.com> added the comment:

This was changed in Python 3.2+ in Issue 16723. The response object no longer 
sets the “closed” attribute when it runs out of data; it is only set when the 
“close” method is called. Perhaps the example should be amended so that it 
checks if “read” returned an empty string, rather than checking “closed”.

Another problem with the example is that printing the chunk as a bytes object 
can trigger BytesWarning. I would add a “repr” call to avoid that.

----------
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, martin.panter

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to