mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] gh-96005: Handle WASI ENOTCAPABLE in getpath (GH-96006) (GH-96034) (GH-96038)
- 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
c4cf745c72
commit
bc337a7766
7 changed files with 35 additions and 6 deletions
|
@ -3644,6 +3644,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