Berker Peksag added the comment:
This looks like a bug in ncurses 5.7 and a duplicate of issue 15037.
--
nosy: +berker.peksag
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> curses.unget_wch and test_curses fail when linked with ncurses
5.7 and
Changes by Ankur Ankan ankuran...@gmail.com:
--
nosy: +Ankur.Ankan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16293
___
___
Python-bugs-list
STINNER Victor added the comment:
The following example returns immediatly, whereas I expected it to block. So I
consider that ungetch(-1) should fail, but I may be wrong.
---
import curses
def test_screen(screen):
screen.nodelay(True)
key = screen.getch()
screen.nodelay(False)
STINNER Victor added the comment:
Do you consider this behaviour as a bug? What is the behaviour in C?
Le 21 oct. 2012 03:25, Julian Berman rep...@bugs.python.org a écrit :
New submission from Julian Berman:
The following code now raises an OverflowError on 3.3:
import curses
def
Julian Berman added the comment:
Hi, sorry for being terse :).
After checking a bit, man 3 getch says that it returns ERR (-1) in non-blocking
mode if no input is available. I think you're right though -- calling ungetch
without checking for the error value seems like it should be a bug in
New submission from Julian Berman:
The following code now raises an OverflowError on 3.3:
import curses
def test_screen(screen):
screen.nodelay(True)
key = screen.getch()
screen.nodelay(False)
curses.ungetch(key)
curses.wrapper(test_screen)
or equivalently just
def