[issue36840] Add stream.abort() async method

2019-05-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed by #36889 -- resolution: -> fixed stage: -> resolved status: open -> closed superseder: -> Merge StreamWriter and StreamReader into just asyncio.Stream ___ Python tracker

[issue36840] Add stream.abort() async method

2019-05-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: The reason is: until connection_lost() is called the transport is in the active state. Destruction of closing-but-not-closed-yet trasport raises a ResourceWarning. Plain TCP socket calls connection_lost() on the next loop iteration after .abort() call. SS

[issue36840] Add stream.abort() async method

2019-05-07 Thread Yury Selivanov
Yury Selivanov added the comment: If we're just calling socket.close(), then what's the point of waiting for connection_lost? (I remember us discussing this, but I don't quite remember the details). Usually .abort() is a synchronous method, which kind of signals that "i want to close this

[issue36840] Add stream.abort() async method

2019-05-07 Thread Andrew Svetlov
New submission from Andrew Svetlov : It should call underlying `transport.abort()`, then wait for closing event (`await self.wait_closed()`) -- components: asyncio messages: 341811 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Add stream.abort() async