[ python-Bugs-893250 ] curses getkey() crash in raw mode
SourceForge.net
noreply at sourceforge.net
Mon Feb 9 02:11:13 EST 2004
Bugs item #893250, was opened at 2004-02-09 01:11
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=893250&group_id=5470
Category: Extension Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: J. David Lee (bogjohnson)
Assigned to: Nobody/Anonymous (nobody)
Summary: curses getkey() crash in raw mode
Initial Comment:
Using python 2.3.3 on gentoo I have the following problem:
When calling stdscr.getkey() in raw mode, the program
crashes on a terminal resize event. In cooked and
cbreak modes, the proper string is returned -
"KEY_RESIZE". This problem appeared after upgrading
from python 2.3.2, I believe. Below is a quick program
that exhibits this behavior on my machine.
#######################################################
#!/usr/bin/env python
import curses;
stdscr = curses.initscr();
curses.raw();
curses.noecho();
stdscr.keypad(1);
while(1):
stdscr.clear();
stdscr.addstr("Enter key: ");
c = stdscr.getkey();
if(c == 'q'):
break;
stdscr.clear();
stdscr.addstr('"' + c + '"\n\n');
stdscr.addstr("Press any key...");
stdscr.getkey();
curses.noraw();
curses.endwin();
#######################################################
A couple of other notes:
1) No exception is thrown (a try block doesn't catch it).
2) The behavior is the same using the interactive
interpreter.
3) The traceback is: File "./keyname", line 19, in ?
stdscr.getkey(); _curses.error: no input
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=893250&group_id=5470
More information about the Python-bugs-list
mailing list