Questions tagged [getpass]

Use for questions concerning the Python stdlib module which provides secure and portable password input

Many programs that interact with the user via the terminal need to ask the user for password values without showing what the user types on the screen. The getpass module provides a portable way to handle such password prompts securely.

52 questions
1
vote
1 answer

getpass behaves different in pychram IDE and terminal

paaword.py is a script where getpass() asked the user about the password and validates it. but i want to automate the whole process and used subprocess for it (main.py). And i am using python3.10 Problem: problem is when i run the main.py in pycharm…
1
vote
1 answer

Pyinstaller with concurrent.futures executing function call on every process start

Edit: So I've been playing around with this; placing the getpass() call under the if name block, placing it in main, outside of main, the big issue is when it runs in the IDE or CLI normally it works as intended. But when I run it from frozen…
Rufom1
  • 89
  • 9
1
vote
1 answer

Is it possible to hide the getpass() warning?

Is it possible to hide the message that gets displayed if getpass() cannot hide the message? GetPassWarning: Can not control echo on the terminal. Warning: Password input may be echoed. Is it possible to replace this message with something else…
Python
  • 47
  • 8
1
vote
2 answers

Python get user input password with timeout

I'm writing a Python application and would like to prompt a user for their password. If they do not enter it within 60 seconds, the program should exit. If they do enter it, their password should be hidden in the terminal. How do I do…
whoopscheckmate
  • 746
  • 8
  • 23
1
vote
1 answer

SMTP getpass.getpass() not accepting input, can you fix this?

I am trying to create a password protected server but, when I go in to type my password, the output doesn’t let me type in the password. All the other inputs work just getpass doesn’t let me type input. Please help import smtplib,…
user12327406
1
vote
1 answer

What does "GetPassWarning: Can not control echo on the terminal" mean? "Inappropriate ioctl for device"?

I wrote a script that sends an email with the daily holiday. It works when run independently. I also wrote a script that sets a cronjob for it to run automatically, which correctly sets a cronjob, but the emails never send. The cronjob does work for…
BenG
  • 116
  • 2
  • 11
1
vote
1 answer

Using getpass with Sublime Text

Like the title says I am tryin gto use the getpass library with sublime text (and SublimeREPL.) When I run a simple piece of code, I get nothing but a blank screen in the sublime terminal and the REPL terminal. Is there any way to get getpass to…
1
vote
1 answer

Pytest mock hide expected password

I am testing a function that gets a login and a password from the command line. The code below works as expected: # ---------- Function part ---------- import getpass def my_function(): login = input('Login: ') password =…
Simpom
  • 938
  • 1
  • 6
  • 23
1
vote
2 answers

How to use argparse in the actual script

How does argparse work? I was told to 'hide' the password from the psycopg2 connection I am building so to be able to run the script automatically every week and being able to share it between departments. This is the beginning of the psycopg2…
ccasimiro9444
  • 425
  • 1
  • 6
  • 22
1
vote
0 answers

Python - getpass2 to python3 configuration problems

So lately, i've been working on my osu! Map Downloader, which i've posted about today.. too. So, my second problem is that when i try to create a hidden password, i can't. Well, i'm sure you know the library getpass. If not this is it: getpass2 .…
Nathan
  • 13
  • 4
0
votes
0 answers

Multiprocessing using GetPass

Running my multiprocessing script while using the getpass function in python (import getpass): and I keep getting this error message. I am also running this code in a .py file on my command prompt terminal, using windows 10 as well. error…
Richard
  • 1
  • 1
0
votes
0 answers

Issues with multiprocessing and import get pass

Trying to write a multiprocessing code using the import get pass module import time from multiprocessing import Pool from multiprocessing import freeze_support import getpass import jaydebeapi import pandas as pd import numpy as np pw =…
0
votes
0 answers

Not able to pipe through a inputpassword in python

I am trying to pass this pipe stnd input from a script password.py. this script excepts a password from user. but it is not allowing me to see by piping the input through a screen from subprocess. I want to use subprocess to automate the process…
0
votes
0 answers

Undefined reference to 'getpass' in c

#include #include int main() { char *itm; char *qnt; qnt,itm = getpass(""); printf("%s %s ",qnt,itm); return 0; } So if i run this code in online compiler like replit , it runs without error . But when i run it in…
0
votes
0 answers

Telnet login in python

I have been trying to make a automated python login system, but I keep getting this error: Traceback (most recent call last): File "/home/kali/py.py", line 14, in tn.read_until(b"Password: ") File "/usr/lib/python3.9/telnetlib.py",…
BOBERT
  • 13
  • 4