Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.
This repository was archived by the owner on May 31, 2021. It is now read-only.

Example TCP echo server code does not exit cleanly #27

Closed
@hollymcr

Description

@hollymcr

The example TCP echo server code does not exit cleanly from KeyboardInterrupt if a client is connected:

$ python3  --version
Python 3.6.3

$pip3 show asyncio
Name: asyncio
Version: 3.4.3

$ python3  echo-server.py
Serving on ('127.0.0.1', 9001)
# Connect a client but don't send anything
^C
Task was destroyed but it is pending!
task: <Task pending coro=<handle_echo() done, defined at echo-server.py:3> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fa8f396c0a8>()]>>

Removing the last line (loop.close()) resolves the issue, although I'm not sure why.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions