diff --git a/HISTORY.txt b/HISTORY.txt index 1dae3553..6235c00d 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,3 +1,5 @@ +Unreleased: + - Update pexcept to fix shellquote issues in subprocesses. 8.1.4: - Tell users in compatibility mode how to exit the shell. - Updated patched pip's vendored pkg-resources. diff --git a/pipenv/vendor/pexpect/popen_spawn.py b/pipenv/vendor/pexpect/popen_spawn.py index a795c8a9..0a1b2261 100644 --- a/pipenv/vendor/pexpect/popen_spawn.py +++ b/pipenv/vendor/pexpect/popen_spawn.py @@ -15,6 +15,7 @@ except ImportError: from .spawnbase import SpawnBase, PY3 from .exceptions import EOF +from .utils import string_types class PopenSpawn(SpawnBase): if PY3: @@ -39,10 +40,11 @@ class PopenSpawn(SpawnBase): kwargs['startupinfo'] = startupinfo kwargs['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP - if not isinstance(cmd, (list, tuple)): - cmd = shlex.split(cmd, posix=(os.name == 'posix')) + if isinstance(cmd, string_types) and sys.platform != 'win32': + cmd = shlex.split(cmd, posix=os.name == 'posix') self.proc = subprocess.Popen(cmd, **kwargs) + self.pid = self.proc.pid self.closed = False self._buf = self.string_type() diff --git a/pipenv/vendor/pexpect/replwrap.py b/pipenv/vendor/pexpect/replwrap.py index 118aa9f2..ed0e657d 100644 --- a/pipenv/vendor/pexpect/replwrap.py +++ b/pipenv/vendor/pexpect/replwrap.py @@ -114,9 +114,9 @@ def bash(command="bash"): # replwrap seeing that as the next prompt, we'll embed the marker characters # for invisible characters in the prompt; these show up when inspecting the # environment variable, but not when bash displays the prompt. - ps1 = PEXPECT_PROMPT[:5] + u'\[\]' + PEXPECT_PROMPT[5:] - ps2 = PEXPECT_CONTINUATION_PROMPT[:5] + u'\[\]' + PEXPECT_CONTINUATION_PROMPT[5:] + ps1 = PEXPECT_PROMPT[:5] + u'\\[\\]' + PEXPECT_PROMPT[5:] + ps2 = PEXPECT_CONTINUATION_PROMPT[:5] + u'\\[\\]' + PEXPECT_CONTINUATION_PROMPT[5:] prompt_change = u"PS1='{0}' PS2='{1}' PROMPT_COMMAND=''".format(ps1, ps2) - return REPLWrapper(child, u'\$', prompt_change, + return REPLWrapper(child, u'\\$', prompt_change, extra_init_cmd="export PAGER=cat") diff --git a/pipenv/vendor/pexpect/utils.py b/pipenv/vendor/pexpect/utils.py index ae0fe9dc..bafc2805 100644 --- a/pipenv/vendor/pexpect/utils.py +++ b/pipenv/vendor/pexpect/utils.py @@ -11,6 +11,11 @@ except NameError: # Alias Python2 exception to Python3 InterruptedError = select.error +if sys.version_info[0] >= 3: + string_types = (str,) +else: + string_types = (unicode, str) + def is_executable_file(path): """Checks that path is an executable regular file, or a symlink towards one.