curses in Python 2.0?

Erik Max Francis max at alcyone.com
Sun Nov 5 14:32:23 EST 2000


I just upgraded from Python 1.5.2 to 2.0, and curses doesn't seem to
work anymore.  I run cplay (an mp3 player frontend in Python), and even
after explicitly building and installing the _curses module (initially
import curses failed because the curses module itself tried to import
_curses), I now get the following error:

max at charmaine:~% /usr/local/bin/python `which cplay`
Traceback (most recent call last):
  File "/usr/local/bin/cplay", line 1173, in main
    app.setup()
  File "/usr/local/bin/cplay", line 1028, in setup
    self.win_root = RootWindow(None)
  File "/usr/local/bin/cplay", line 293, in __init__
    self.win_progress = ProgressWindow(self)
  File "/usr/local/bin/cplay", line 193, in __init__
    Window.__init__(self, parent)
  File "/usr/local/bin/cplay", line 105, in __init__
    self.resize()
  File "/usr/local/bin/cplay", line 136, in resize
    self.w = self.newwin()
  File "/usr/local/bin/cplay", line 197, in newwin
    return curses.newwin(1, self.parent.cols, self.parent.rows-2, 0)
error: curses function returned NULL

In trying to see what's going on with curses, I tried:

max at charmaine:~% python
Python 2.0 (#3, Nov  5 2000, 11:15:21) 
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import curses
>>> curses.initscr()

at which point the screen blanks and I get

<curses window object at 0x818b4d8>
                                   >>> 

where all import is ignored except keyboard interrupts (which is in
contrast to doing the same thing with Python 1.5.2, where curses mode is
obviously interfering with the Python interpreter, but you can still
issue commands).

Any idea what's going on here?

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ What do women want?
\__/ Sigmund Freud
    Alcyone Systems' CatCam / http://www.catcam.com/
 What do your pets do all day while you're at work?  Find out.



More information about the Python-list mailing list