Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 42562a1 + 0781dac commit d71699dCopy full SHA for d71699d
1 file changed
pre_commit/languages/python.py
@@ -67,9 +67,10 @@ def _find_by_py_launcher(
67
) -> Optional[str]: # pragma: no cover (windows only)
68
if version.startswith('python'):
69
num = version[len('python'):]
70
+ cmd = ('py', f'-{num}', '-c', 'import sys; print(sys.executable)')
71
+ env = dict(os.environ, PYTHONIOENCODING='UTF-8')
72
try:
- cmd = ('py', f'-{num}', '-c', 'import sys; print(sys.executable)')
- return cmd_output(*cmd)[1].strip()
73
+ return cmd_output(*cmd, env=env)[1].strip()
74
except CalledProcessError:
75
pass
76
return None
0 commit comments