https://github.com/python/cpython/commit/462f64b4136cc9c7645257ab81981e749ed087c5
commit: 462f64b4136cc9c7645257ab81981e749ed087c5
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2026-06-15T14:52:51Z
summary:

[3.14] gh-148853: Catch PermissionError in test 
in_systemd_nspawn_sync_suppressed() (GH-148854) (#151505)

gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() 
(GH-148854)

/run/ on my FreeBSD install is not readable causing failing test.
(cherry picked from commit 35ce2e5f98c04cb8d1e442de5439d3151362e21b)

Co-authored-by: Nick Begg <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>

files:
A Misc/NEWS.d/next/Tests/2026-04-24-01-38-56.gh-issue-148853._uM4_Q.rst
M Lib/test/support/__init__.py

diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 701d34bba2d4dd0..e0ca34cc1891707 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -3073,7 +3073,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-24-01-38-56.gh-issue-148853._uM4_Q.rst 
b/Misc/NEWS.d/next/Tests/2026-04-24-01-38-56.gh-issue-148853._uM4_Q.rst
new file mode 100644
index 000000000000000..9d3fbc2590dc7a2
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2026-04-24-01-38-56.gh-issue-148853._uM4_Q.rst
@@ -0,0 +1,2 @@
+Fix tests failing on FreeBSD in test.support's
+in_systemd_nspawn_sync_suppressed()  due to unreadable /run directory.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to