Skip to content

Commit 84ad304

Browse files
committed
locale is only available in Python 3.10 and later
1 parent f81cfce commit 84ad304

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/poetry/utils/env/base_env.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,9 @@ def _run(self, cmd: list[str], **kwargs: Any) -> str:
335335
subprocess.check_call(cmd, stderr=stderr, env=env, **kwargs)
336336
output = ""
337337
else:
338+
encoding = "locale" if sys.version_info >= (3, 10) else None
338339
output = subprocess.check_output(
339-
cmd, stderr=stderr, env=env, text=True, encoding="locale", **kwargs
340+
cmd, stderr=stderr, env=env, text=True, encoding=encoding, **kwargs
340341
)
341342
except CalledProcessError as e:
342343
raise EnvCommandError(e)

0 commit comments

Comments
 (0)