cpython/Doc/reference
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
..
compound_stmts.rst gh-122845: fix parameter_list_starargs in function definition pseudo-grammar (#122847) 2025-01-21 20:04:07 +00:00
datamodel.rst Postpone module.__loader__ deprecation to Python 3.16 (#126482) 2024-11-09 16:48:33 -08:00
executionmodel.rst gh-70870: Clarify dual usage of 'free variable' (#122545) 2024-10-08 07:52:12 +00:00
expressions.rst gh-69639: Add mixed-mode rules for complex arithmetic (C-like) (GH-124829) 2024-11-26 17:57:39 +02:00
grammar.rst Docs: Add label to grammar spec for linking from PEPs (#113235) 2023-12-17 12:23:14 -07:00
import.rst gh-115911: Ignore PermissionError during import from cwd (#116131) 2025-01-26 19:00:28 +00:00
index.rst
introduction.rst GH-103484: Fix permanently redirects reported by linkcheck (GH-124144) 2024-09-17 02:53:38 +00:00
lexical_analysis.rst gh-125461: Remove Python 2 from identifiers in doc (GH-125462) 2024-10-14 15:26:57 +00:00
simple_stmts.rst Docs: Miscellaneous corrections to simple statements in the language reference (GH-126720) 2024-11-15 13:02:34 -08:00
toplevel_components.rst GH-97950: Use new-style index directive ('builtin') (#104164) 2023-05-06 06:54:08 +03:00