[Python-bugs-list] [ python-Bugs-754455 ] sigwinch crashes python with curses

SourceForge.net noreply at sourceforge.net
Tue Oct 21 09:06:42 EDT 2003


Bugs item #754455, was opened at 2003-06-14 06:51
Message generated for change (Comment added) made by akuchling
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: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: A.M. Kuchling (akuchling)
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: A.M. Kuchling (akuchling)
Date: 2003-10-21 09:06

Message:
Logged In: YES 
user_id=11375

I agree with MvL; this is not a bug.  An explanation of this point is worth 
including in the curses HOWTO at some point, though.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-06-14 09: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



More information about the Python-bugs-list mailing list