multiple curses initializations fail to restore terminal properly
Bug #492140 reported by
Alex Grubb
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python |
Fix Released
|
Unknown
|
|||
python2.6 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Lucid |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: python2.6
When trying to open and close multiple curses sessions within python, the terminal is not restored to a clean state after the second and successive sessions.
A simple example:
import curses
def main():
w = curses.initscr()
curses.endwin()
w = curses.initscr()
curses.endwin()
if __name__ == "__main__":
main()
Code is tested to work on a Fedora Core 5 machine and exits with a clean terminal, but produces a garbled terminal on Ubuntu 9.10 which requires a 'reset' call.
python2.6 package is version 2.6.4-0ubuntu2
libncurses5 package is version 5.7+20090803-
Changed in python2.6 (Ubuntu): | |
status: | New → Confirmed |
Changed in python: | |
status: | Unknown → New |
Changed in python: | |
status: | New → Fix Committed |
Changed in python: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
In my project (OOF, Object Oriented Finite Elements, http:// www.ctcms. nist.gov/ oof), we have gotten complaints from Ubuntu users, which we have traced to this bug. We use a "w=curses. initscr( ); s=w.getxymax(); curses.endwin()" sequence to get the screen width for drawing text-mode progress bars, which we do multiple times, because the screen width might have changed. Also, our test suite uses these text-mode progress bars, and fails on Ubuntu because of this bug.
We have worked around it by only checking the screen width once, and assuming/hoping it doesn't change.
The bug is present in python2.6 package version 2.6.2-0ubuntu1 (ships with 9.04 "Jaunty") and 2.6.4-0ubuntu3 (ships with 9.10 "Karmic").