[issue7567] Messed up terminal after calling curses.initscr() twice.

Sami Zerrade report at bugs.python.org
Sat Jan 30 11:38:36 CET 2010


Sami Zerrade <szerrade at gmail.com> added the comment:

This is being caused by the following 2 new lines in the initscr() function of Lib/curses/__init__.py:


setupterm(term=_os.environ.get("TERM", "unknown"),
            fd=_sys.__stdout__.fileno())

Commenting them out will cause the behavior from version 2.5.  


In general, invoking the C curses library's setupterm() function after the C initscr() function has been called will cause the terminal to break the next time that endwin() is called.  In this particular case, the first call to the Python initscr() function provides the call to the C initscr() and the second call to Python's initscr() provides the call to setupterm().  The bug can be fixed by having the Python initscr() function in __init__.py make sure that initscr hasn't been called before making the call to setupterm().

----------
nosy: +Sami.Zerrade

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7567>
_______________________________________


More information about the Python-bugs-list mailing list