mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +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> |
||
---|---|---|
.. | ||
builtin | ||
extension | ||
frozen | ||
import_ | ||
metadata | ||
namespace_pkgs | ||
partial | ||
resources | ||
source | ||
__init__.py | ||
__main__.py | ||
abc.py | ||
test_abc.py | ||
test_api.py | ||
test_lazy.py | ||
test_locks.py | ||
test_namespace_pkgs.py | ||
test_pkg_import.py | ||
test_spec.py | ||
test_threaded_import.py | ||
test_util.py | ||
test_windows.py | ||
threaded_import_hangers.py | ||
util.py |