From 2dd04cf3f1b28d52c4ace17790dd4aba6692e6ce Mon Sep 17 00:00:00 2001 From: Hugo Sansaqua Date: Sat, 21 Oct 2023 04:46:14 +0900 Subject: [PATCH] Force run_python_script and the child python to use UTF-8 --- src/poetry/utils/env/base_env.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/poetry/utils/env/base_env.py b/src/poetry/utils/env/base_env.py index eb8dac6cf97..40ecfbe3895 100644 --- a/src/poetry/utils/env/base_env.py +++ b/src/poetry/utils/env/base_env.py @@ -327,6 +327,8 @@ def run_python_script(self, content: str, **kwargs: Any) -> str: "-I", "-W", "ignore", + "-X", + "utf8", "-", input_=content, stderr=subprocess.PIPE, @@ -352,6 +354,7 @@ def _run(self, cmd: list[str], **kwargs: Any) -> str: check=True, env=env, text=True, + encoding="utf-8", **kwargs, ).stdout elif call: