You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
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 signal
TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object
This will not occur if you register a handler for another signal, such as SIGINT.
It does actually occur for all signals except SIGINT (SIGINT has a special treatment in loop.remove_signal_handler). This error has been reported on bugs.python.org as issue32548. I've looked into it, and it turns out this problem is unrelated to asyncio. It can be reproduced using the _signal module only:
It also affects python 2. This happens because the signalmodule resources are cleared before the garbage collector calls a.__del__. It causes this if statement to fail and a misleading TypeError is raised.
It's quite similar to issue 14173 (fixed in 2012).
If you register a signal handler for SIGTERM, start the event loop then kill it with CTRL + C, you get this error:
Minimal code to get the error:
This will not occur if you register a handler for another signal, such as SIGINT.
The text was updated successfully, but these errors were encountered: