Fix encoding issue

This commit is contained in:
twangboy 2018-02-27 14:38:07 -07:00
parent adc8950bbe
commit 415821eee9
No known key found for this signature in database
GPG key ID: 93FF3BDEB278C9EB
2 changed files with 2 additions and 6 deletions

View file

@ -139,11 +139,7 @@ def _get_pip_bin(bin_env):
# try to get pip bin from virtualenv, bin_env
if os.path.isdir(bin_env):
if salt.utils.platform.is_windows():
if six.PY2:
pip_bin = os.path.join(
bin_env, 'Scripts', 'pip.exe').encode('string-escape')
else:
pip_bin = os.path.join(bin_env, 'Scripts', 'pip.exe')
pip_bin = os.path.join(bin_env, 'Scripts', 'pip.exe')
else:
pip_bin = os.path.join(bin_env, 'bin', 'pip')
if os.path.isfile(pip_bin):

View file

@ -298,7 +298,7 @@ class PipTestCase(TestCase, LoaderModuleMockMixin):
with patch.dict(pip.__salt__, {'cmd.run_all': mock}):
if salt.utils.platform.is_windows():
venv_path = 'c:\\test_env'
bin_path = os.path.join(venv_path, 'Scripts', 'pip.exe').encode('string-escape')
bin_path = os.path.join(venv_path, 'Scripts', 'pip.exe')
else:
venv_path = '/test_env'
bin_path = os.path.join(venv_path, 'bin', 'pip')