Repository: pre-commit/pre-commit

Issue:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 9: invalid start byte
Hi, there! Get such error on commit.

Probably, because of cyrillic symbols in user name: 'C:\\Users\\Администратор\...'.

Is there a way to avoid this problem exept renaming user?

Thanks for your cool product!

### version information

```
pre-commit version: 2.4.0
sys.version:
    3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)]
sys.executable: c:\program files\git\dev\core\venv\scripts\python.exe
os.name: nt
sys.platform: win32
```

### error information

```
An unexpected error has occurred: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 9: invalid start byte
```

```
Traceback (most recent call last):
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\error_handler.py", line 56, in error_handler
    yield
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\main.py", line 372, in main
    args=args.rest[1:],
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\commands\hook_impl.py", line 217, in hook_impl
    return retv | run(config, store, ns)
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\commands\run.py", line 357, in run
    for hook in all_hooks(config, store)
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\repository.py", line 206, in all_hooks
    for repo in root_config['repos']
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\repository.py", line 207, in <genexpr>
    for hook in _repository_hooks(repo, store, root_config)
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\repository.py", line 182, in _repository_hooks
    return _cloned_repository_hooks(repo_config, store, root_config)
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\repository.py", line 162, in _cloned_repository_hooks
    for hook in repo_config['hooks']
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\repository.py", line 162, in <listcomp>
    for hook in repo_config['hooks']
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\repository.py", line 110, in _hook
    ret['language_version'] = languages[lang].get_default_version()
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\languages\python.py", line 113, in get_default_version
    if _find_by_py_launcher(exe):
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\languages\python.py", line 72, in _find_by_py_launcher
    return cmd_output(*cmd)[1].strip()
  File "c:\program files\git\dev\core\venv\lib\site-packages\pre_commit\util.py", line 164, in cmd_output
    stdout = stdout_b.decode() if stdout_b is not None else None
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 9: invalid start byte

```


Discussion:
huh that's certainly a new one, can you show the output of `py -3 -c 'import sys; print(sys.executable)'`?
Ups.. Windows has crashed after user directory renaming manipulations. So can't do that.

Has only this screen runned in PyCharm.

![image](https://user-images.githubusercontent.com/36341495/83046679-06322980-a050-11ea-8730-48c61f7d177f.png)

Seems like it is not actual issue due to investigation inability.
ok, I should be able to fix this -- I'll work on this later today

Resolving patch:
diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py
--- a/pre_commit/languages/python.py
+++ b/pre_commit/languages/python.py
@@ -67,9 +67,10 @@ def _find_by_py_launcher(
 ) -> Optional[str]:  # pragma: no cover (windows only)
     if version.startswith('python'):
         num = version[len('python'):]
+        cmd = ('py', f'-{num}', '-c', 'import sys; print(sys.executable)')
+        env = dict(os.environ, PYTHONIOENCODING='UTF-8')
         try:
-            cmd = ('py', f'-{num}', '-c', 'import sys; print(sys.executable)')
-            return cmd_output(*cmd)[1].strip()
+            return cmd_output(*cmd, env=env)[1].strip()
         except CalledProcessError:
             pass
     return None


Test patch: