[Python-bugs-list] [ python-Bugs-754455 ] sigwinch crashes python with curses
SourceForge.net
noreply@sourceforge.net
Sat, 14 Jun 2003 06:43:13 -0700
Bugs item #754455, was opened at 2003-06-14 12:51
Message generated for change (Comment added) made by loewis
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754455&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: sigwinch crashes python with curses
Initial Comment:
[forwarded from http://bugs.debian.org/178205]
I'm not able to reproduce this bug in current 2.1/2.2.
In 2.3 CVS 20030614, changing the window size of an
xterm results in the crash
The following code crashes. It does not occur when
getkey () is not used.
# Crash python
import curses, signal, time, sys
def sigwinch (signum, frame): return
win = curses.initscr ()
signal.signal(signal.SIGWINCH, sigwinch)
while 1: win.getkey ()
curses.endwin ()
Traceback (most recent call last):
File "curs.py", line 9, in ?
while 1: win.getkey ()
_curses.error: no input
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2003-06-14 15:43
Message:
Logged In: YES
user_id=21627
This is not a bug in Python. In _cursesmodule.c rev. 2.70,
Patch #633635 from David M. Cooke was implemented, which
makes the implementation match the documentation:
getch([x, y])
Get a character. Note that the integer returned does not
have to be in ASCII range: function keys, keypad keys and so
on return numbers higher than 256. In no-delay mode, an
exception is raised if there is no input.
This exception is raised when the underlying wgetch returns
ERR, so if there is a bug here, it might be in ncurses, for
having wgetch return on window change.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754455&group_id=5470