Skip to content

Script wrappers generated from Python debug executable do not point to the right executable #218

@Holt59

Description

@Holt59

Describe the bug

When installing a package containing script wrappers from setuptools using a debug installation of Python on Windows, the script wrappers do not point to the right python_d.exe.

This is a follow-up from pypa/setuptools#4418

To Reproduce

  1. Build Python in debug mode on Windows.
  2. Install a package containing scripts via python_d.exe -m pip install XXX. Below is non-working package:
# setup.py
from setuptools import setup

setup(
    name="package",
    version="0.0.1",
    entry_points={"console_scripts": ["test_python_debug_main = package.main:main"]},
)
# pyproject.toml
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
  1. Try to run the generated test_python_debug_main.exe.
  2. The exe will throw the following error (paths removed):
Fatal error in launcher: Unable to create process using '"python.exe"  "Scripts\test_python_debug_main.exe" ': The system cannot find the file specified.

Expected behavior

The script wrappers should use the right executable, i.e., python_d.exe.

Environment

  • Windows 11 Pro, 23H2, 22631.3672
  • pip 24.0

Metadata

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