← Back to team overview

sikuli-driver team mailing list archive

[Question #697957]: getpass echos password

 

New question #697957 on SikuliX:
https://answers.launchpad.net/sikuli/+question/697957

I have a little snippet of code shown below, which logs me into a web page. However, the password is retrieved "in the clear". 
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
import getpass

def waitText(text, time):
    while time > 0:
        match = findText(text)
        if match: return match
        time -= 1
    return null

myApp = App("chrome")
myApp.open()

type("l", Key.CTRL)
type("https://localhost:7443/gui\n";)
type(Key.SPACE, Key.ALT)
type("x")

u = input('Userid: ')
p = getpass.getpass()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When this runs, the console shows:

rfb@rfb:~/projects/sikuli$ java -jar act/act_demo_about_sikuli.jar
[error] Hot key conflicts
[error] HotkeyManager: addHotkey: failed
[log] ( Ctrl )  TYPE "l"
[log]  TYPE "https://localhost:7443/gui#ENTER.";
[log] ( Alt )  TYPE " "
[log]  TYPE "x"
Password: password    <--- This is not good

I'm trying to get that password from the user without echoing it.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.