multiple curses initializations fail to restore terminal properly

Bug #492140 reported by Alex Grubb
10
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-2ubuntu2

Changed in python2.6 (Ubuntu):
status: New → Confirmed
Changed in python:
status: Unknown → New
Revision history for this message
Andrew Reid (reidac) wrote :

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").

Changed in python:
status: New → Fix Committed
Revision history for this message
Matthias Klose (doko) wrote :

fixed in 2.6.6~rc1-1ubuntu1 in maverick, candidate for a lucid update.

Changed in python2.6 (Ubuntu):
status: Confirmed → Fix Released
Changed in python2.6 (Ubuntu Lucid):
milestone: none → lucid-updates
status: New → In Progress
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in python2.6 (Ubuntu Lucid):
status: In Progress → Won't Fix
Changed in python:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.