[New-bugs-announce] [issue42050] ensurepip fails if cwd contains illformed setup.cf

Hartmut Goebel report at bugs.python.org
Fri Oct 16 04:27:23 EDT 2020


New submission from Hartmut Goebel <h.goebel at crazy-compilers.com>:

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

----------
components: Library (Lib)
messages: 378706
nosy: htgoebel
priority: normal
severity: normal
status: open
title: ensurepip fails if cwd contains illformed setup.cf
type: crash
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42050>
_______________________________________


More information about the New-bugs-announce mailing list