gh-96005: Handle WASI ENOTCAPABLE in getpath (GH-96006)

- On WASI `ENOTCAPABLE` is now mapped to `PermissionError`.
- The `errno` modules exposes the new error number.
- `getpath.py` now ignores `PermissionError` when it cannot open landmark
  files `pybuilddir.txt` and `pyenv.cfg`.
This commit is contained in:
Christian Heimes 2022-08-16 20:20:15 +02:00 committed by GitHub
parent f215d7cac9
commit 48174fa0b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 4 deletions

View file

@ -657,3 +657,12 @@ defined by the module. The specific list of defined symbols is available as
Interface output queue is full
.. versionadded:: 3.11
.. data:: ENOTCAPABLE
Capabilities insufficient. This error is mapped to the exception
:exc:`PermissionError`.
.. availability:: WASI
.. versionadded:: 3.11.1

View file

@ -746,7 +746,12 @@ depending on the system error code.
Raised when trying to run an operation without the adequate access
rights - for example filesystem permissions.
Corresponds to :c:data:`errno` :py:data:`~errno.EACCES` and :py:data:`~errno.EPERM`.
Corresponds to :c:data:`errno` :py:data:`~errno.EACCES`,
:py:data:`~errno.EPERM`, and :py:data:`~errno.ENOTCAPABLE`.
.. versionchanged:: 3.11.1
WASI's :py:data:`~errno.ENOTCAPABLE` is now mapped to
:exc:`PermissionError`.
.. exception:: ProcessLookupError