Paul Sigonoso Paul Sigonoso - 1 year ago 241
Python Question

"GetPassWarning: Can not control echo on the terminal" when running from IDLE

When I run this code:

import getpass

p = getpass.getpass(prompt='digite a senha\n')
if p == '12345':
print('YO Paul')
print('O seu input foi:', p) # p = seu input

I got this warning:

Warning (from warnings module):
File "/usr/lib/python3.4/", line 63
passwd = fallback_getpass(prompt, stream)
GetPassWarning: Can not control echo on the terminal. Warning: Password input may be echoed.

Answer Source

Use an actual terminal -- that is, an environment where stdin, stdout and stderr are connected to /dev/tty, or another PTY-compliant device.

The IDLE REPL does not meet this requirement.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download