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.

Author JBernardo
Recipients JBernardo
Date 2011-06-29.01:06:30
SpamBayes Score 3.6345602e-07
Marked as misclassified No
Message-id <1309309591.85.0.564668230133.issue12438@psf.upfronthosting.co.za>
In-reply-to
Content
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
    stacklevel=2)
  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
'ok'
>>> 



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))
History
Date User Action Args
2011-06-29 01:06:32JBernardosetrecipients: + JBernardo
2011-06-29 01:06:31JBernardosetmessageid: <1309309591.85.0.564668230133.issue12438@psf.upfronthosting.co.za>
2011-06-29 01:06:31JBernardolinkissue12438 messages
2011-06-29 01:06:30JBernardocreate