python subprocess invocation to inject setuptools pollutes setuptools argument list
See original GitHub issuesetuptools (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 https://github.com/pypa/pip/blob/9b11ed231cc0c7a8101f1ffbdc8b352a12c511b7/pip/req/req_install.py#L868 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 https://github.com/pypa/pip/blob/9b11ed231cc0c7a8101f1ffbdc8b352a12c511b7/pip/req/req_install.py#L843 and similar invocations within pip:
import sys, setuptools, tokenize
sys.argv[0] = %r; ....
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Python setuptools entrypoints and subapplications as child ...
I have one setupttools distribution that contains a nandful of python packages. This distribution declares some console_scripts entrypoints that ...
Read more >shiv — shiv documentation
Shiv is a command line utility for building fully self-contained Python zipapps as outlined in PEP 441 but with all their dependencies included!...
Read more >Changelog — Python 3.11.1 documentation
gh-97612: Fix a shell code injection vulnerability in the get-remote-certificate.py example script. The script no longer uses a shell to run openssl commands....
Read more >PyInstaller Documentation - Read the Docs
stead invoke the PyInstaller module, by running python -m PyInstaller (pay ... Use the --osx-bundle-identifier argument to add a bundle identifier.
Read more >PyInvoke
Invoke is a Python (2.7 and 3.4+) library for managing ... Fix a non-fatal bug in our setup.py long_description generation causing ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Happy 5 year birthday for this issue (last month)! Thank you for resolving this @cjerdonek 😃
FWIW, the review/diff URL mentioned in my earlier comment is now https://reviews.freebsd.org/D270
@cjerdonek I think the best way to answer that question is wherever the issue is found/reproducible, which at the time of the report, was distutils, setuptools, pip.
I looked through @marcusva’s history around the time this issue was created and couldn’t see a referenced setuptools bug report