Skip to content

shutdown() tries to access non-existent attribute "cancel" on uasyncio module #46

@phlipped

Description

@phlipped

asyncio.cancel(self._server_coro)

Board: esp8266, generic nodeMCU dev board
Micropython: 1.17 (esp8266 port), with frozen modules tinyweb and logging

I'm trying to perform the "shutdown" procedure as per instructions in the reference material for the webserver class, i.e.

async def all_shutdown():
    await asyncio.sleep_ms(100)

try:
    web = tinyweb.webserver()
    web.run()
except KeyboardInterrupt as e:
    print(' CTRL+C pressed - terminating...')
    web.shutdown()
    uasyncio.get_event_loop().run_until_complete(all_shutdown())

When I run my server then hit Ctrl-C, I get:

Traceback (most recent call last):
  File "main.py", line 30, in run
  File "tinyweb/server.py", line 689, in shutdown
  File "uasyncio/__init__.py", line 1, in __getattr__
AttributeError: cancel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions