You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is heavily used in Azure CLI and its extensions. Azure-devops extension uses this function to accept Personal Access Token for login. Since it is an arbitrary long string people are used to using Ctrl+v for it.
Although the issue is in getpass library code.. Not sure where to follow up on it.
Confirmed by reproducing the above behavior using these code snippets:
### CODE PART 2 - Issue using getpass ###
# import getpass
# password = getpass.getpass(prompt="Password: ")
# print(password)
### CODE PART 3 - Issue using win_getpass function from the getpass module ###
# import msvcrt
# def win_getpass(prompt='Password: ', stream=None):
# """Prompt for password with echo off, using Windows getch()."""
# for c in prompt:
# msvcrt.putwch(c)
# pw = ""
# while 1:
# c = msvcrt.getwch()
# if c == '\r' or c == '\n':
# break
# if c == '\003':
# raise KeyboardInterrupt
# if c == '\b':
# pw = pw[:-1]
# else:
# pw = pw + c
# msvcrt.putwch('\r')
# msvcrt.putwch('\n')
# return pw
# password = win_getpass(prompt="Password: ")
# print(password)
Issue: prompt_pass is not working on windows with CTRL+V being used to enter the input
Repro:
Steps to repro:
python getpass_fails.py
Actual Behavior:
Expected Behavior:
WORKAROUND: The issue in only in using Ctrl+V to paste. If we use console menu or right click to paste it works correctly.
The text was updated successfully, but these errors were encountered: