-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #116 #117
Fix #116 #117
Conversation
If |
As it seems, you can only pass bytes on Python 2 - on Python 3, it's the other way around:
How do you work around py2/3 issues usually here? |
So I would write a function that does the proper checks for windows and then version in def password_prompt(prompt_text): # Always expects unicode for our own sanity
prompt = prompt_text
if 'nt' in platform_info:
if sys.version_info < (3, 0):
prompt = prompt_text.encode('utf8')
return functools.partial(getpass.getpass, prompt=prompt)
get_password = functools.partial(
# ...
prompt_strategy=password_prompt("Enter your password:"),
) |
I just updated the PR - sorry that it took so long. 😃 |
Travis is happy now as well. |
Sorry I missed that you had updated this @mhils! Thanks for fixing this! 🍰 |
getpass.getpass
only acceptsstr
as its first parameter on Windows.Closes #116
Python 2:
getpass.getpass
only acceptsstr
as its first parameter on Windows.Python 3:
getpass.getpass
only acceptsunicode
as its first parameter on Windows.