diff --git a/src/poetry/utils/env/base_env.py b/src/poetry/utils/env/base_env.py index 2e5006f4074..d01da7d3c65 100644 --- a/src/poetry/utils/env/base_env.py +++ b/src/poetry/utils/env/base_env.py @@ -338,6 +338,13 @@ def run_pip(self, *args: str, **kwargs: Any) -> str: return self._run(cmd, **kwargs) def run_python_script(self, content: str, **kwargs: Any) -> str: + # Options Used: + # -I : Run Python in isolated mode. (#6627) + # -W ignore : Suppress warnings. + # + # TODO: Consider replacing (-I) with (-EP) once support for managing Python <3.11 environments dropped. + # This is useful to prevent user site being disabled over zealously. + return self.run( self._executable, "-I", diff --git a/src/poetry/utils/env/script_strings.py b/src/poetry/utils/env/script_strings.py index a2935b566e9..05e037d75e8 100644 --- a/src/poetry/utils/env/script_strings.py +++ b/src/poetry/utils/env/script_strings.py @@ -104,7 +104,8 @@ def _version_nodot(version): if site.check_enableusersite(): paths["usersite"] = site.getusersitepackages() - paths["userbase"] = site.getuserbase() + +paths["userbase"] = site.getuserbase() print(json.dumps(paths)) """