termios, Python 2.1 and 1.5.2, AIX and SCO

MikeK mkent at atlantic.net
Thu Jun 7 15:04:16 EDT 2001


Getting the 'termios' module to compile or work on various platforms is
like trying to pass a bowling ball.

We need to input no-echoing passwords, therefore the need for termios.

Building Python 2.1 on aix-4.3-2.1, with termios turned on in Modules/Setup,
results in undefined symbol errors for 'VDISCARD' and 'VWERASE'.

Building Python 1.5.2 on the same platform, with termios turned on, works
fine, and gives us non-echoing passwords via getpass.

Building Python 1.5.2 on SCO Open Server 5, with termios turned on, yields
echoing passwords.  Hmm.  Upon further investingation (browsing the
getpass.py source code), we found that the configure script believes this
platform to be sco_sv3, and that the necessary file
Lib/plat_sco_sv3/TERMIOS.py was missing.  Running the 'regen' script in
that directory created TERMIOS.py, which allowed a build of python with
termios turned on.  However, when testing getpass, it would now generate
a termios.error exception.  From investigating this (debugging termios.c),
we determined that a call to tcsetattr was returning an error code and
setting errno to 22 (Invalid argument).

We gave up at that point.

Wasn't one of the selling points of Python the ability to write code that
would run on multiple platforms?

Does anyone have any suggestions on how we can overcome these problems, the
desired result being non-echoing passwords done in a portable manner?



More information about the Python-list mailing list