[ python-Bugs-1119331 ] curses.initscr - initscr exit w/o env(TERM) set

SourceForge.net noreply at sourceforge.net
Thu Feb 10 01:06:54 CET 2005


Bugs item #1119331, was opened at 2005-02-09 08:51
Message generated for change (Comment added) made by jrlilly
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1119331&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jacob Lilly (jrlilly)
Assigned to: Nobody/Anonymous (nobody)
Summary: curses.initscr - initscr exit w/o env(TERM) set

Initial Comment:
the initscr in ncurses will cause an immeadiation exit
if the env doesn't have the TERM variable set.  Could
the curses.initscr be changed so it tests if TERM is
set and raises an exception?  It would be helpful to be
able to try and except this instead of just having
ncurses exit for you.

----------------------------------------------------------------------

>Comment By: Jacob Lilly (jrlilly)
Date: 2005-02-09 18:06

Message:
Logged In: YES 
user_id=774886

if you pass setupterm 0 for the term name it just tries to
get the env variable, so the env test should cover it pretty
well.  It might make more sense to check the env first and
then pass "unkown", setuperm("unknown", -1).  This would
seem to match the path that curses initscr follows.  This
would also raise _curses and curses shared exception.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2005-02-09 17:19

Message:
Logged In: YES 
user_id=6656

Yeah, I noticed that.  We could at least call setupterm(0, NULL) first, I 
guess...

----------------------------------------------------------------------

Comment By: Jacob Lilly (jrlilly)
Date: 2005-02-09 13:51

Message:
Logged In: YES 
user_id=774886

that is any return of 0 from newterm

----------------------------------------------------------------------

Comment By: Jacob Lilly (jrlilly)
Date: 2005-02-09 13:49

Message:
Logged In: YES 
user_id=774886

sorry, I should have done that in the beginning; I have it
raising a RuntimeError, I think thats what it is.  This
doesn't really solve the problem in whole, since ncurses
initscr has lots of ways it could decide to decide to exit
(any return value from newterm causes it to exit), but it
does solve a more common one.  Anything else would require
modifying ncruses to be responsible.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2005-02-09 12:45

Message:
Logged In: YES 
user_id=6656

How amazingly terrible (on ncurses part).  Do you want to/are you able 
to work on a patch?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1119331&group_id=5470


More information about the Python-bugs-list mailing list