termios, Python 2.1 and 1.5.2, AIX and SCO

Thomas Wouters thomas at xs4all.net
Sun Jun 10 00:04:52 CEST 2001

On Thu, Jun 07, 2001 at 12:04:16PM -0700, MikeK wrote:

> 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'.

This problem is fixed in 2.1.1 and 2.2, neither of which are released yet.
You can grab the working tree of 2.1.1 from the CVS tree (cvs co
-rrelease21-maint) or fix the bug yourself; you have to change

#ifndef VDISCARD



in termiosmodule.c, and similar for VWERASE. The 2.1.1 CVS branch should be
pretty stable (it contains only bugfixes) but it hasn't been tested yet, and
it isn't ready to be released yet (still have a couple of bugfixes to
backport, and I want to give people some more time to find bugs too, on
platforms untested up to now :)

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

Well, I had to work on SCO Open Server (3) once. I gave up way earlier, and
I wasn't even trying to compile anything. 

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

Yes, but you hit one of the least portable aspects of any program. I'm
afraid you also hit the Open Source barrier: noone tested Python on a SCO
Open Server 5, and none of the developers have access to such a box, and
noone volunteered any information about SCO Open Server 5, so we don't know
anything is wrong, let alone what is wrong or try to find out.

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

You can try to find out why the tcsetattr is returning an errorcode. Maybe
the termios module calls it the wrong way ? The wrong arguments ? Maybe you
need special privileges to set such a mode ? 

Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!

More information about the Python-list mailing list