From 8574f142cca0eca2df8bb936478e5a2aefced8ec 2021-11-07 04:12:47
From: Matthias Bussonnier <bussonniermatthias@gmail.com>
Date: 2021-11-07 04:12:47
Subject: [PATCH] Merge pull request #13170 from deep-jkl/fix-pathlib-init-virtualenv

Convert WindowsPath to str in init_virtualenv.
---

diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py
index dc3c726..c831aa4 100644
--- a/IPython/core/interactiveshell.py
+++ b/IPython/core/interactiveshell.py
@@ -932,7 +932,7 @@ class InteractiveShell(SingletonConfigurable):
             return
 
         if sys.platform == "win32":
-            virtual_env = Path(os.environ["VIRTUAL_ENV"], "Lib", "site-packages")
+            virtual_env = str(Path(os.environ["VIRTUAL_ENV"], "Lib", "site-packages"))
         else:
             virtual_env_path = Path(
                 os.environ["VIRTUAL_ENV"], "lib", "python{}.{}", "site-packages"