X Tutup
The Wayback Machine - https://web.archive.org/web/20260321141215/https://github.com/python/cpython/issues/94338
Skip to content

distutils.spawn.find_executable does not handle case on Windows #94338

@jd

Description

@jd

Bug report

Calling distutils.spawn.find_executable("python.EXE") on Windows, where python.EXE actually exists fails because of the current code which does this:

    _, ext = os.path.splitext(executable)
    if (sys.platform == 'win32') and (ext != '.exe'):
        executable = executable + '.exe'

This code does not handle the case, which means the executable is modified to python.EXE.exe and therefore the file is never found.

Your environment

  • CPython 3.10
  • Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only security fixes3.11only security fixesOS-windowstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup