[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

Martin Panter report at bugs.python.org
Tue Oct 27 07:19:55 EDT 2015


Martin Panter added the comment:

David, what’s your use case for doing non-blocking buffered writing “correctly”? Would you be able to use the context manager functionality? I would have thought you would explicitly call flush() as many times as necessary, but only call close() once when you are done.

At least in blocking mode, close() is meant do as much as possible, despite any intermediate exceptions. It doesn’t seem wise to break this rule in non-blocking mode.

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25476>
_______________________________________


More information about the Python-bugs-list mailing list