"GetPassWarning: Cannot Manage Echo on Terminal" when starting from IDLE

When I run this code:

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

I received this warning:

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

Use the actual terminal, i.e. the environment in which stdin , stdout and stderr connected to /dev/tty or another PTY compatible device.

IDLE REPL does not meet this requirement.

+9
source

Run your code in the terminal, not in the IDE. You will see that there are no more warnings. To run your code, enter this command in the terminal:

 python3 your_program.py 
0
source

Source: https://habr.com/ru/post/1259931/


All Articles