J Wint
J Wint

Reputation: 31

Why is my getpass.getpass() not working?

I'm relatively new to Python, but I've searched for answers on this. My code is:

import urllib, http
import gspread
import datetime
import getpass
import sys
from http import cookiejar

pwd = getpass.getpass()

and then obviously a lot more, but it throws me an error right at line 8:

File "C:\Python33\lib\idlelib\PyShell.py", line 60, in idle_showwarning
    file.write(warnings.formatwarning(message, category, filename,
AttributeError: 'NoneType' object has no attribute 'write'"

I'm not sure if it matters, but this is what I'm using the pwd for:

payload = {
  'op': 'login-main',
  'SignonAccountNumber': '###',
  'SignonPassword': pwd
  }

Thanks for your help

Upvotes: 3

Views: 3081

Answers (1)

Twisted
Twisted

Reputation: 113

If you are using IDLE as your editor then your issue may be this bug: http://bugs.python.org/issue18030

In the bug report, the user gets around the issue by running IDLE with this command: python -m idlelib.idle

Upvotes: 1

Related Questions