This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: windows getpass broken on python 2.2
Type: Stage:
Components: Windows Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: tim.peters Nosy List: mwh, tim.peters, wc2so1
Priority: normal Keywords:

Created on 2002-04-01 20:05 by wc2so1, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (6)
msg10109 - (view) Author: Brian Kelley (wc2so1) Date: 2002-04-01 20:05
Windows 2000 Python 2.2

>>> import getpass
C:\Python22\lib\termios.py:7: DeprecationWarning: the
TERMIOS module is deprecated; please use termios
  DeprecationWarning)
>>> getpass.getpass()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "c:\python22\lib\getpass.py", line 29, in
unix_getpass
    old = termios.tcgetattr(fd)     # a copy to save
AttributeError: 'module' object has no attribute
'tcgetattr'
>>>

I think the problem is that TERMIOS.py and termios.py
are the same thing on windows which causes a strange
Deprecation warning.  Python 2.1 used to fail on import
of termios

C:\Documents and Settings\bkelley\My
Documents\Downloads\Webware>python
Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for
more information.
>>> import termios
C:\Python22\lib\termios.py:7: DeprecationWarning: the
TERMIOS module is deprecated; please use termios
  DeprecationWarning)

anyway, TERMIOS.py should probably not be installed on
windows.  This should be removed from 2.2.1c2
Brian
msg10110 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2002-04-01 20:45
Logged In: YES 
user_id=6656

Oops.  That sucks.

Tim, this must be case confusion of some kind.  termios.py 
has never existed, however there's now a placeholder Lib/
TERMIOS.py, deprecated in favour of using the termios 
(lowercase) module.  Is Brian's suggestion of just not 
installing TERMIOS.py feasible?

Brian: thanks!
msg10111 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2002-04-01 21:09
Logged In: YES 
user_id=31435

getpass() works fine on Windows:

C:\Python22>python
Python 2.2.1c2 (#33, Mar 26 2002, 13:04:18) [MSC 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import getpass
>>> getpass.getpass()
Password:
'abc'
>>>

I suspect Brian has set the PYTHONCASEOK envar on Windows, 
in which case any number of insane things can happen (it 
tells Python to ignore case mismatches then).  Brian?

Not shipping TERMIOS.py isn't an option.
msg10112 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2002-04-02 18:40
Logged In: YES 
user_id=6656

Oh good.  Lowering priority on assumption this isn't our 
fault.

Maybe PYTHONCASEOK should die?
msg10113 - (view) Author: Brian Kelley (wc2so1) Date: 2002-04-02 18:50
Logged In: YES 
user_id=424987

For some reason a lowercase "termios.pyc" ended up in my
python directory.  I removed it and everything worked fine.
 If it happens again, I'll let you all know.
msg10114 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2002-04-02 19:18
Logged In: YES 
user_id=31435

Closing as Not-a-Bug.  If it pops up again, we can reopen 
it.  PYTHONCASEOK will probably never die -- as the "Import 
on Case-Insensitive Filesystems" PEP explains, it's 
necessary if Python is to work at all on some case-
*destroying* filesystems (which, alas, still exist).
History
Date User Action Args
2022-04-10 16:05:10adminsetgithub: 36367
2002-04-01 20:05:05wc2so1create