Don’t encode a unicode string

- We can’t encode once it’s already encoded
This commit is contained in:
Daniel Hobley 2018-04-11 15:18:39 +02:00
parent 6503bf8dfa
commit 838670f626

View file

@ -130,7 +130,8 @@ def _get_pip_bin(bin_env):
'pip{0}'.format(sys.version_info[0]),
'pip', 'pip-python']
)
if salt.utils.platform.is_windows() and six.PY2:
if salt.utils.platform.is_windows() and six.PY2 \
and isinstance(which_result, str):
which_result.encode('string-escape')
if which_result is None:
raise CommandNotFoundError('Could not find a `pip` binary')