From 1c6acfecb5db81575ea3af8266dbf08bb812324c Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Tue, 24 Jul 2018 20:24:06 -0400 Subject: [PATCH] Ensure that we use posix style strings instead of Path objects for chdir context manager Signed-off-by: Dan Ryan --- pipenv/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pipenv/utils.py b/pipenv/utils.py index b45081fe..be1240ac 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -1367,7 +1367,9 @@ def is_virtual_environment(path): def chdir(path): """Context manager to change working directories.""" from ._compat import Path - prev_cwd = Path.cwd() + prev_cwd = Path.cwd().as_posix() + if isinstance(path, Path): + path = path.as_posix() os.chdir(str(path)) try: yield