New submission from Marc Schlaich <marc.schla...@googlemail.com>:

After closing a StreamWriter the `StreamReaderProtocol.connection_lost` on the 
other end is not getting called. In this case the StreamReader is at EOF but 
calling write/drain does not raise any Exception (and sending data to Nirvana). 

I would expect that StreamWriter.is_closing returns True after the close and 
calling write/drain raises immediately and not just after the second call. 
Please see attached example. I see the same behavior with Proactor and Selector 
event loop on Windows.

Maybe this is expected behavior. But in this case it is completely 
undocumented. Should there be a check for `StreamReader.at_eof` (and maybe 
`StreamReader.exception`) before writing to the StreamWriter?

This might be related to bpo-34176.

----------
components: asyncio
files: tcp_test.py
messages: 334450
nosy: asvetlov, schlamar, yselivanov
priority: normal
severity: normal
status: open
title: Control flow inconsistency on closed asyncio stream
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48082/tcp_test.py

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

Reply via email to