[New-bugs-announce] [issue41207] distutils.command.build_ext raises FileNotFoundError

Jason R. Coombs report at bugs.python.org
Fri Jul 3 21:25:52 EDT 2020


New submission from Jason R. Coombs <jaraco at jaraco.com>:

In [pypa/setuptools#2228](https://github.com/pypa/setuptools/issues/2228), by adopting the distutils codebase from a late release of CPython, Setuptools stumbled onto an API-breaking change in distutils rooted at issue39763.

Details are in the Setuptools investigation, but to summarize:

- distutils.ccompiler.CCompiler.compile declares "raises CompileError on failure" and calls `self._compile`, implemented by subclasses.
- In at least `distutils.unixcompiler.UnixCCompiler._compile`, `distutils.spawn.spawn` is called (through CCompiler.spawn).
- Since GH-18743, `distutils.spawn.spawn` calls `subprocess.Popen` which raises FileNotFoundError when the target executable doesn't exist.
- Programs trapping CompileError but not FileNotFoundError will crash where once they had error handling.

Setuptools discovered this behavior in the 48.0 release when it incorporated these distutils changes into a vendored release of Setuptools, but the failures exhibited will apply to all builds (including pyyaml) on Python 3.9.

----------
assignee: lukasz.langa
components: Distutils
keywords: 3.9regression
messages: 372973
nosy: dstufft, eric.araujo, jaraco, lukasz.langa
priority: release blocker
severity: normal
status: open
title: distutils.command.build_ext raises FileNotFoundError
type: crash
versions: Python 3.9

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


More information about the New-bugs-announce mailing list