[Tutor] getpass

Kalle Svensson kalle@gnupung.net
Fri, 19 Jan 2001 18:29:58 +0100

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Sez Jose Amoreira:
> Hello!
> Something odd happened to me with the getpass module. Let me cut and
> paste from my shell:
> pandora:pytut$ python
> Python 2.0 (#4, Nov 24 2000, 11:42:48)
> [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> import getpass
> >>> name =3D getpass.getpass('Type your name: ')
> Warning: Problem with getpass. Passwords may be echoed.
> Type your name: Rumpelstitskin
> >>>

I'm assuming Python 2.0.

According to getpass.py, there are two reasons that you get default_getpass=
which is the getpass implementation that prints the warning, instead of
unix_getpass(), which should work.  Either

import termios, TERMIOS

raises an ImportError, or

fd =3D sys.stdin.fileno()

raises an unspecified exception.  Try to figure out which one it is.

Email: kalle@gnupung.net     | You can tune a filesystem, but you
Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
PGP fingerprint: 0C56 B171 8159 327F 1824 F5DE 74D7 80D7 BF3B B1DD

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org