mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +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> |
||
---|---|---|
.. | ||
__init__.py | ||
__main__.py | ||
test___loader__.py | ||
test___package__.py | ||
test_api.py | ||
test_caching.py | ||
test_fromlist.py | ||
test_helpers.py | ||
test_meta_path.py | ||
test_packages.py | ||
test_path.py | ||
test_relative_imports.py |