Skip to content

python subprocess invocation to inject setuptools pollutes setuptools argument list #1890

@marcusva

Description

@marcusva

setuptools (and probably distutils) assume the very first argument from sys.argv to be the executed setup file. Invoking a python subprocess with -c to execute a command will set '-c' to be the very first argument to sys.argv (see the docs). This leads to the manifest_maker warning noted at

r"^warning: manifest_maker: standard file '-c' not found$"]:
and also will cause arguments to the setuptools (or distutils) commands to be polluted with an additional '-c', whether it's wanted or not.

As a workaround, manipulate the argument list prior to exec() in

"import setuptools, tokenize; __file__=%r; exec(compile("
and similar invocations within pip:

import sys, setuptools, tokenize
sys.argv[0] = %r; ....

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-lockedOutdated issues that have been locked by automationgood first issueA good item for first time contributors to work onproject: setuptoolsRelated to setuptoolstype: enhancementImprovements to functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions