Title: readline steals sigwinch
Type: behavior Stage: test needed
Components: Extension Modules Versions: Python 3.3, Python 3.4, Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: Curses terminal resize problems when Python is in interactive mode
View: 2675
Assigned To: Nosy List: ajaksu2, martin.panter, shish
Priority: normal Keywords:

Created on 2008-09-23 20:59 by shish, last changed 2016-05-15 00:57 by martin.panter. This issue is now closed.

Messages (3)
msg73667 - (view) Author: Shish (shish) Date: 2008-09-23 20:59
I have an app which wants to use a mostly curses interface with some 
parts readline, however, doing so much as "import readline" causes 
readline to claim ownership of sigwinch, thus breaking the ability of 
the app to resize.

Worse, it seems to claim it at the C level -- doing signal.getsignal
(signal.SIGWINCH) returns SIG_DFL, so I can't see anything I can do at 
the python level to manually set the signals to be handled in the way I 
want :-/

I would think it best to set the handler at the start (for 
compatability, and because the vast majority of apps will expect it 
that way), but set it via python's signal module, so that app writers 
can take the signal handler and call it in their own way (In my case, I 
want the app to listen for the signal, and the app's handler will call 
readline's and curses's handlers in turn)
msg87949 - (view) Author: Daniel Diniz (ajaksu2) (Python triager) Date: 2009-05-17 02:42
See related(?) issue 3180.
msg265563 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-05-15 00:57
Is this actually about how SIGWINCH handlers are installed, or is it a complaint about readline affecting how curses handles resize events? I am assuming this is about handling resize events, so is a duplicate of Issue 2675.

If it is specifically about SIGWINCH, I understand Gnu Readline recently changed its SIGWINCH handling so that it only installs the handler when it is active. As a result, we recently changed Python to install its own SIGWINCH handler on behalf of Readline (Issue 23735). But I understand in both cases, the handler for Readline chain calls the original handler, so there should be no problem.
Date User Action Args
2016-05-15 00:57:41martin.pantersetstatus: open -> closed

nosy: + martin.panter
messages: + msg265563

superseder: Curses terminal resize problems when Python is in interactive mode
resolution: duplicate
2013-04-16 14:56:30r.david.murraysetversions: + Python 2.7, Python 3.3, Python 3.4, - Python 2.6
2009-05-17 02:42:48ajaksu2linkissue3949 dependencies
2009-05-17 02:42:41ajaksu2setpriority: normal
versions: + Python 2.6, - Python 2.4
nosy: + ajaksu2

messages: + msg87949

stage: test needed
2008-09-23 20:59:29shishcreate