This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Failure to add signal handlers for any signal but SIGINT
Type: behavior Stage:
Components: asyncio Versions: Python 3.5
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brotherBox, gvanrossum, yselivanov
Priority: normal Keywords:

Created on 2016-11-07 01:43 by brotherBox, last changed 2022-04-11 14:58 by admin.

File name Uploaded Description Edit brotherBox, 2016-11-07 01:43
Messages (3)
msg280182 - (view) Author: (brotherBox) Date: 2016-11-07 01:43
This is the first bug that I file, so please bear with me here. I was advised to file this after running into a strange situation with asyncio 3.4.3. Adding signal handlers for any other signal but SIGINT throws strange exceptions. The attached source code produces the following traceback:

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/", line 501, in __del__
  File "/usr/lib/python3.5/asyncio/", line 58, in close
  File "/usr/lib/python3.5/asyncio/", line 139, in remove_signal_handler
  File "/usr/lib/python3.5/", line 47, in signal
TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object

I asked in #python on freenode and was asked to file this bug.

Thank you for your consideration
msg280184 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2016-11-07 02:34
Hm... We've seen this exact same crash reported several times before, and it was closed without a fix AFAICT each time.


IIUC the conclusion in the latter was that this is due to a bug in the user code (forgetting to close() the event loop).
msg280229 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2016-11-07 19:55
I think I have a patch for this here:
Date User Action Args
2022-04-11 14:58:39adminsetgithub: 72814
2016-11-07 19:55:40yselivanovsetmessages: + msg280229
2016-11-07 02:34:00gvanrossumsetmessages: + msg280184
2016-11-07 02:04:36akuchlingsettitle: Failure to add -> Failure to add signal handlers for any signal but SIGINT
2016-11-07 01:43:19brotherBoxcreate