The problem stems from [this function](https://github.com/pypa/virtualenv/blob/6d8a4ed81f40223a3f9ea1ba5d11be500d9f667a/virtualenv.py#L1542-L1565) which doesn't honor the windows-specific `PATHEXT`. Here's a nearly-identical implementation of that function which *does* handle `PATHEXT` expansion: https://github.com/pre-commit/pre-commit/blob/e2bae300fe2794e2ece25d4cd72127238704bb1e/pre_commit/parse_shebang.py#L21-L42 `distutils.spawn.find_executable` has a similar special case, but only attempts `.exe`: https://github.com/python/cpython/blob/9648088e6ccd6d0cc04f450f55628fd8eda3784c/Lib/distutils/spawn.py#L181-L182
The problem stems from this function which doesn't honor the windows-specific
PATHEXT.Here's a nearly-identical implementation of that function which does handle
PATHEXTexpansion: https://github.com/pre-commit/pre-commit/blob/e2bae300fe2794e2ece25d4cd72127238704bb1e/pre_commit/parse_shebang.py#L21-L42distutils.spawn.find_executablehas a similar special case, but only attempts.exe: https://github.com/python/cpython/blob/9648088e6ccd6d0cc04f450f55628fd8eda3784c/Lib/distutils/spawn.py#L181-L182