Fix #116#117
Merged
sigmavirus24 merged 1 commit intopypa:masterfrom Sep 12, 2015
Merged
Conversation
Member
|
If |
Contributor
Author
|
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? |
Member
|
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:"),
) |
Contributor
Author
|
I just updated the PR - sorry that it took so long. 😃 |
Contributor
Author
|
Travis is happy now as well. |
Member
|
Sorry I missed that you had updated this @mhils! Thanks for fixing this! 🍰 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getpass.getpassonly acceptsstras its first parameter on Windows.Closes #116
Python 2:
getpass.getpassonly acceptsstras its first parameter on Windows.Python 3:
getpass.getpassonly acceptsunicodeas its first parameter on Windows.