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.
Created on 2020年07月04日 01:25 by jaraco, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 21359 | merged | jaraco, 2020年07月06日 20:56 | |
| PR 21373 | merged | miss-islington, 2020年07月07日 11:11 | |
| Messages (10) | |||
|---|---|---|---|
| msg372973 - (view) | Author: Jason R. Coombs (jaraco) * (Python committer) | Date: 2020年07月04日 01:25 | |
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. |
|||
| msg373045 - (view) | Author: Jason R. Coombs (jaraco) * (Python committer) | Date: 2020年07月05日 20:37 | |
In [7aa5abeafc">pypa/distutils@7aa5abeafc ](https://github.com/pypa/distutils/commit/7aa5abeafc1e0b1b351c4c8ac7eb14c310366a46), I've pushed a fix (with a repro test in the parent commit). I recommend this fix be applied to CPython 3.9. |
|||
| msg373047 - (view) | Author: Jason R. Coombs (jaraco) * (Python committer) | Date: 2020年07月05日 21:11 | |
CPython should also consider [this change](https://github.com/pypa/distutils/commit/d9ba43436d), which unifies the `DEBUG` handling, consolidates the exception trapping, and uses `subprocess.check_call` to re-use exit code checking. |
|||
| msg373100 - (view) | Author: Łukasz Langa (lukasz.langa) * (Python committer) | Date: 2020年07月06日 11:57 | |
Good catch! The unification change is 3.10 only but I'm totally fine accepting the _compile fix in Python 3.9. |
|||
| msg373104 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2020年07月06日 12:02 | |
> Programs trapping CompileError but not FileNotFoundError will crash where once they had error handling. Do you mean mean that spawn() of distutils.spawn should catch FileNotFoundError and raise a CompilerError instead? It seems like before my commit 1ec63b62035e73111e204a0e03b83503e1c58f2e, any OSError was catched and replaced with DistutilsExecError, not only FileNotFoundError. Do you want to propose a fix? |
|||
| msg373170 - (view) | Author: Jason R. Coombs (jaraco) * (Python committer) | Date: 2020年07月06日 20:26 | |
Sure. I'll submit patches. |
|||
| msg373172 - (view) | Author: Jason R. Coombs (jaraco) * (Python committer) | Date: 2020年07月06日 20:53 | |
I learned the magical incantation to port commits from pypa/distutils to CPython: ``` cpython bugfix/41207-rewrite-filenotfound $ git -C ~/p/pypa/distutils format-patch HEAD~2 --stdout | git am --directory Lib Applying: Add test for spawn when exe is missing. Ref pypa/distutils#3. Applying: Replace OSError with DistutilsExecError. Fixes pypa/distutils#3 and pypa/setuptools#2228 and bpo-41207. ``` |
|||
| msg373218 - (view) | Author: miss-islington (miss-islington) | Date: 2020年07月07日 11:11 | |
New changeset 6ae2780be0667a8dc52c4fb583171ec86067d700 by Jason R. Coombs in branch 'master': bpo-41207 In distutils.spawn, rewrite FileNotFound (GH-21359) https://github.com/python/cpython/commit/6ae2780be0667a8dc52c4fb583171ec86067d700 |
|||
| msg373219 - (view) | Author: miss-islington (miss-islington) | Date: 2020年07月07日 11:31 | |
New changeset 2c82628e9aa2af4b662e92e227618859675dd726 by Miss Islington (bot) in branch '3.9': bpo-41207 In distutils.spawn, rewrite FileNotFound (GH-21359) https://github.com/python/cpython/commit/2c82628e9aa2af4b662e92e227618859675dd726 |
|||
| msg373220 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2020年07月07日 11:58 | |
I close the issue since it's fixed. I also reset the priority. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:33 | admin | set | github: 85379 |
| 2020年07月07日 11:58:53 | vstinner | set | status: open -> closed priority: release blocker -> messages: + msg373220 resolution: fixed stage: patch review -> resolved |
| 2020年07月07日 11:31:44 | miss-islington | set | messages: + msg373219 |
| 2020年07月07日 11:11:57 | miss-islington | set | pull_requests: + pull_request20517 |
| 2020年07月07日 11:11:44 | miss-islington | set | nosy:
+ miss-islington messages: + msg373218 |
| 2020年07月06日 20:56:18 | jaraco | set | keywords:
+ patch stage: patch review pull_requests: + pull_request20504 |
| 2020年07月06日 20:53:00 | jaraco | set | messages: + msg373172 |
| 2020年07月06日 20:26:40 | jaraco | set | messages: + msg373170 |
| 2020年07月06日 12:02:40 | vstinner | set | nosy:
+ vstinner messages: + msg373104 |
| 2020年07月06日 11:57:16 | lukasz.langa | set | messages: + msg373100 |
| 2020年07月05日 21:11:07 | jaraco | set | messages: + msg373047 |
| 2020年07月05日 20:37:12 | jaraco | set | messages: + msg373045 |
| 2020年07月04日 01:26:02 | jaraco | set | versions: + Python 3.10 |
| 2020年07月04日 01:25:52 | jaraco | create | |