Skip to content

Commit

Permalink
locale is only available in Python 3.10 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering committed Feb 10, 2024
1 parent f81cfce commit 84ad304
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/poetry/utils/env/base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ def _run(self, cmd: list[str], **kwargs: Any) -> str:
subprocess.check_call(cmd, stderr=stderr, env=env, **kwargs)
output = ""
else:
encoding = "locale" if sys.version_info >= (3, 10) else None
output = subprocess.check_output(
cmd, stderr=stderr, env=env, text=True, encoding="locale", **kwargs
cmd, stderr=stderr, env=env, text=True, encoding=encoding, **kwargs
)
except CalledProcessError as e:
raise EnvCommandError(e)
Expand Down

0 comments on commit 84ad304

Please sign in to comment.