[Python-checkins] commit of r41907 - python/trunk/Makefile.pre.in

"Martin v. Löwis" martin at v.loewis.de
Fri Jan 6 01:24:53 CET 2006


skip at pobox.com wrote:
>     Martin> Not sure where the "Error opening terminal" message comes from -
>     Martin> whoever produces this probably also cause process abortion.
> 
> On my Mac that's present in /usr/lib/libncurses.5.dylib.  That tells me the
> tty test isn't doing what it's supposed to do.  Apparently execution is
> still getting to the "import curses" line.

Ah. I guess some OSX guru would need to investigate that. It should
*never* be possible for in import statement to abort the interpreter
without an exception.

OTOH, it's hard to see why a plain import could cause this, in the
first place. init_curses does not call any curses functions.

Thinking about it: more likely, the test that Neal added
(os.isatty(sys.stdin.fileno())) *passes*, and it is the
call to initscr that crashes.

Apparently, the string after this message ("unknown" in your case)
is meant to indicate the terminal name (e.g. from the TERM
variable).

If I do the following on Linux, I get the same effect:

martin at mira:~/work/py2.5$ TERM=unknown ./python
Python 2.5a0 (2.4.5, Jan  6 2006, 00:43:47)
[GCC 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
py> import curses
py> curses.initscr()
Error opening terminal: unknown.

So you can easily get ncurses to abort your program if it doesn't
know the terminal.

So we would rather need an ncurses guru, then, to find out why
this happens and how it could be avoided.

Regards,
Martin


More information about the Python-checkins mailing list