This repository was archived by the owner on Nov 23, 2017. It is now read-only.
Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork178
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object #396
Closed
Description
If you register a signal handler for SIGTERM, start the event loop then kill it with CTRL + C, you get this error:
Exception ignored in: <bound method BaseEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=True debug=False>>Traceback (most recent call last): File "/usr/lib/python3.5/asyncio/base_events.py", line 431, in __del__ File "/usr/lib/python3.5/asyncio/unix_events.py", line 58, in close File "/usr/lib/python3.5/asyncio/unix_events.py", line 140, in remove_signal_handler File "/usr/lib/python3.5/signal.py", line 47, in signalTypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object
Minimal code to get the error:
import signalimport asyncioloop = asyncio.get_event_loop()def bar(): loop.stop()loop.add_signal_handler(signal.SIGTERM, bar)loop.run_forever()
This will not occur if you register a handler for another signal, such as SIGINT.
Metadata
Metadata
Assignees
Labels
No labels