-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Labels
extmodRelates to extmod/ directory in sourceRelates to extmod/ directory in source
Description
async def __aexit__(self, exc_type, exc, tb):
await self.close()
def close(self):
pass
If used in an asynchronous context manager it seems that the socket is not closed.
[EDIT]
The CPython docs make no reference to async context managers. They do say of StreamReader
:
As an asynchronous iterable, the object supports the async for statement.
This doesn't appear to be supported but would be useful.
Further, on StreamWriter.close()
the docs say:
The method closes the stream and the underlying socket.
In a microcontroller context failing to close sockets (read and write) is a regular cause of OOM errors.
Metadata
Metadata
Assignees
Labels
extmodRelates to extmod/ directory in sourceRelates to extmod/ directory in source