mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
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:
parent
f215d7cac9
commit
48174fa0b9
6 changed files with 31 additions and 4 deletions
|
|
@ -3635,6 +3635,11 @@ _PyExc_InitState(PyInterpreterState *interp)
|
|||
ADD_ERRNO(InterruptedError, EINTR);
|
||||
ADD_ERRNO(PermissionError, EACCES);
|
||||
ADD_ERRNO(PermissionError, EPERM);
|
||||
#ifdef ENOTCAPABLE
|
||||
// Extension for WASI capability-based security. Process lacks
|
||||
// capability to access a resource.
|
||||
ADD_ERRNO(PermissionError, ENOTCAPABLE);
|
||||
#endif
|
||||
ADD_ERRNO(ProcessLookupError, ESRCH);
|
||||
ADD_ERRNO(TimeoutError, ETIMEDOUT);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue