asweigart / asweigart/pyinputplus

Empty mask in inputPassword

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
114
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Hi Al,

When using an empty string (mask='') as a mask, stdiomask falls back on python's getpass resulting in printing the prompt after entering the password (on return), this is due to setting end='' in print.

To fix it, the orginal code (line 157..161) should be updated as follows:

```
# Get the user input.
if passwordMask is None:
userInput = input(prompt)
else:
userInput = stdiomask.getpass(prompt=prompt, mask=passwordMask)
```

regards
![python27112019pyinputplus](https://user-images.githubusercontent.com/55244128/69686610-31938600-10b8-11ea-9082-d12b1516ee40.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.