[docs] [issue36074] Result of `asyncio.Server.sockets` after `Server.close()` is not clear

Kevin Mai-Hsuan Chia report at bugs.python.org
Fri Feb 22 08:20:51 EST 2019


Kevin Mai-Hsuan Chia <kevin at mhchia.com> added the comment:

Excuse me, I tried 3.7.2 and 3.8.0a1+ with the following code and still failed. Could you help me to try this? or can you give me a pointer to the code returning `None`? Sorry for the inconvenience and thanks a lot.
```
import asyncio
import platform


async def close_server():
    def handler(reader, writer):
        pass
    s = await asyncio.start_server(handler, host='127.0.0.1', port=34567)
    s.close()
    await s.wait_closed()
    assert s.sockets is None


print("version: ", platform.python_version())
asyncio.get_event_loop().run_until_complete(close_server())
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36074>
_______________________________________


More information about the docs mailing list