diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 2cac70f4ab2afb..2200d7e05104d0 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -3164,7 +3164,7 @@ def in_systemd_nspawn_sync_suppressed() -> bool: with open("/run/systemd/container", "rb") as fp: if fp.read().rstrip() != b"systemd-nspawn": return False - except FileNotFoundError: + except (FileNotFoundError, PermissionError): return False # If systemd-nspawn is used, O_SYNC flag will immediately diff --git a/Misc/NEWS.d/next/Tests/2026-04-22-09-15-13.gh-issue-148853:.bP3jhQ.rst b/Misc/NEWS.d/next/Tests/2026-04-22-09-15-13.gh-issue-148853:.bP3jhQ.rst new file mode 100644 index 00000000000000..02392adf883e82 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-04-22-09-15-13.gh-issue-148853:.bP3jhQ.rst @@ -0,0 +1 @@ +Tests failing on FreeBSD due to unreadable /run fixes