cpython/Lib/importlib
Alex Willmer a8dc6d6d44
gh-115911: Ignore PermissionError during import from cwd (#116131)
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>
2025-01-26 19:00:28 +00:00
..
metadata
resources gh-123987: Fix NotADirectoryError in NamespaceReader when sentinel present (#124018) 2025-01-26 16:23:54 +00:00
__init__.py gh-125519: Improve traceback if importlib.reload() is called with a non-module object (#125520) 2024-10-21 07:53:21 +01:00
_abc.py
_bootstrap.py
_bootstrap_external.py gh-115911: Ignore PermissionError during import from cwd (#116131) 2025-01-26 19:00:28 +00:00
abc.py gh-121604: fix ResourceLoader deprecation warning message (GH-128859) 2025-01-15 21:13:59 +00:00
machinery.py gh-121604: Make sure all deprecated items in importlib raise DeprecationWarning (#128007) 2025-01-14 16:48:46 -08:00
readers.py
simple.py
util.py