[issue44212] asyncio overrides signal handlers

2021-05-21 Thread Francisco Demartino


Change by Francisco Demartino :


--
keywords: +patch
pull_requests: +24904
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26306

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44212] asyncio overrides signal handlers

2021-05-21 Thread Francisco Demartino


Francisco Demartino  added the comment:

Looks like Roger Dahl also noted this on https://bugs.python.org/issue39765:

> Second, set_signal_handler()[sic] silently and implicitly removes 
> corresponding handlers set with signal.signal(). [...]  I think this should 
> be documented as well.

(then has a linked PR that apparently doesn't address this second part)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44212] asyncio overrides signal handlers

2021-05-21 Thread Francisco Demartino


New submission from Francisco Demartino :

Hello,

It looks like when asyncio sets up a signal handler, it forgets about the 
previous one (if any).

Here's a patch (was about to create a PR but the default text brought me to 
bugs.python.org)
https://github.com/franciscod/cpython/commit/bdac885b86fbb01d0d775f40c47870e48af5fa5b

Tracked this down to the initial asyncio checkout, in commit 
27b7c7ebf1039e96cac41b6330cf16b5632d9e49, a few commits before v3.4.0a4.

Not sure if this is a bug but it surprised me. I would have expected that it 
registered an "additional" signal handler, or at least that my previously 
installed signal handler would be called afterwards.

Also I'm not sure that it's a good idea to suddenly start running handlers that 
some current code might rely on not running, or have worked around this 
behaviour otherwise.

Thanks,
Francisco

--
components: asyncio
messages: 394174
nosy: Francisco Demartino, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio overrides signal handlers
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com