This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ensurepip fails if cwd contains illformed setup.cf
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: FFY00, con-f-use, dstufft, htgoebel, ncoghlan, pradyunsg
Priority: normal Keywords:

Created on 2020-10-16 08:27 by htgoebel, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
shell-session.txt con-f-use, 2021-01-30 11:31
Messages (2)
msg378706 - (view) Author: Hartmut Goebel (htgoebel) Date: 2020-10-16 08:27
If the current directory contains a ill-formed setup.cfg, setting up a virtual env fails, caused by ensurepip failing:

Expected behaviour:
running ensurepip should completely ignore the content of the current working directory.

How to reproduce:

$ rm -rf /tmp/v2
$ mkdir /tmp/v2
$ cd /tmp/v2
$ cat > setup.cfg <<EOF
> [options]
> setuptools_requires
> EOF
$ python3 -m venv /tmp/v2/_venv
Error: Command '['/tmp/v2/_venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 2.
$ /tmp/v2/_venv/bin/python3 -Im ensurepip --upgrade --default-pip
Looking in links: /tmp/tmpimoh6tke
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Exception:
…
configparser.ParsingError: Source contains parsing errors: 'setup.cfg'
        [line  2]: 'setuptools_requires\n'


Environment:
Tested with both Python 3.8.2 and 3.7.6
msg385980 - (view) Author: Jan Christoph (con-f-use) * Date: 2021-01-30 11:31
Just wanted to say, I ran into this while using direnv. See the issue I opened before knowing of this one: https://bugs.python.org/issue43038
History
Date User Action Args
2022-04-11 14:59:36adminsetgithub: 86216
2021-01-30 11:31:05con-f-usesetfiles: + shell-session.txt
nosy: + con-f-use
messages: + msg385980

2021-01-27 16:01:11ned.deilylinkissue43038 superseder
2020-10-18 00:31:06FFY00setnosy: + ncoghlan, dstufft, pradyunsg, FFY00
2020-10-16 08:27:23htgoebelcreate