diff --git a/src/poetry/utils/env.py b/src/poetry/utils/env.py index 52f3f8fa690..4cd3acfab75 100644 --- a/src/poetry/utils/env.py +++ b/src/poetry/utils/env.py @@ -544,7 +544,7 @@ def get_python_version( if executable: python_patch = decode( subprocess.check_output( - [executable, "-c", GET_PYTHON_VERSION_ONELINER], + [str(executable), "-c", GET_PYTHON_VERSION_ONELINER], ).strip() ) @@ -579,7 +579,7 @@ def activate(self, python: str) -> Env: try: python_version_string = decode( subprocess.check_output( - [python_path, "-c", GET_PYTHON_VERSION_ONELINER], + [str(python_path), "-c", GET_PYTHON_VERSION_ONELINER], ) ) except CalledProcessError as e: @@ -906,7 +906,7 @@ def create_venv( if executable: python_patch = decode( subprocess.check_output( - [executable, "-c", GET_PYTHON_VERSION_ONELINER], + [str(executable), "-c", GET_PYTHON_VERSION_ONELINER], ).strip() ) python_minor = ".".join(python_patch.split(".")[:2]) @@ -954,7 +954,7 @@ def create_venv( try: python_patch = decode( subprocess.check_output( - [python, "-c", GET_PYTHON_VERSION_ONELINER], + [str(python), "-c", GET_PYTHON_VERSION_ONELINER], stderr=subprocess.STDOUT, ).strip() )