Skip to content

Windows virtualenv -p python2.7 fails even when python2.7.exe exists #1062

Closed
@asottile

Description

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 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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions