[New-bugs-announce] [issue12438] getpass error on idle

João Bernardo report at bugs.python.org
Wed Jun 29 03:06:31 CEST 2011

New submission from João Bernardo <jbvsmo at gmail.com>:

The getpass function is raising an error when first used on idle (Python 3.2 and 2.7.1)

The next time it'll work "as expected" (it echoes the data, but idle is just for testing purposes so no problems here)

>>> from getpass import getpass
>>> p = getpass()
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    p = getpass()
  File "/usr/lib/python3.2/getpass.py", line 55, in unix_getpass
    passwd = fallback_getpass(prompt, stream)
  File "/usr/lib/python3.2/getpass.py", line 114, in fallback_getpass
  File "/usr/lib/python3.2/idlelib/PyShell.py", line 62, in idle_showwarning
    lineno, file=file, line=line))
TypeError: idle_formatwarning() got an unexpected keyword argument 'file'
>>> p = getpass()
Warning: Password input may be echoed.
Password: ok

>>> p

Looking at the "/usr/lib/python3.2/idlelib/PyShell.py" file the "idle_formatwarning" function don't have the "file" argument so it should be revomed from the function call at line 61:

file.write(warnings.formatwarning(message, category, filename,
                                  lineno, file=file, line=line))

components: IDLE
messages: 139385
nosy: JBernardo
priority: normal
severity: normal
status: open
title: getpass error on idle
type: crash
versions: Python 2.7, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list