mirror of
https://github.com/python/cpython.git
synced 2025-11-10 18:42:04 +00:00
Ignore PermissionError when checking cwd during import On macOS `getcwd(3)` can return EACCES if a path component isn't readable, resulting in PermissionError. `PathFinder.find_spec()` now catches these and ignores them - the same treatment as a missing/deleted cwd. Introduces `test.support.os_helper.save_mode(path, ...)`, a context manager that restores the mode of a path on exit. This is allows finer control of exception handling and robust environment restoration across platforms in `FinderTests.test_permission_error_cwd()`. Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Brett Cannon <brett@python.org> |
||
|---|---|---|
| .. | ||
| metadata | ||
| resources | ||
| __init__.py | ||
| _abc.py | ||
| _bootstrap.py | ||
| _bootstrap_external.py | ||
| abc.py | ||
| machinery.py | ||
| readers.py | ||
| simple.py | ||
| util.py | ||