Skip to content

Commit 462f64b

Browse files
miss-islingtonneek78blurb-it[bot]
authored
[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 35ce2e5) Co-authored-by: Nick Begg <nick@stunttruck.net> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
1 parent d06b473 commit 462f64b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/support/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3073,7 +3073,7 @@ def in_systemd_nspawn_sync_suppressed() -> bool:
30733073
with open("/run/systemd/container", "rb") as fp:
30743074
if fp.read().rstrip() != b"systemd-nspawn":
30753075
return False
3076-
except FileNotFoundError:
3076+
except (FileNotFoundError, PermissionError):
30773077
return False
30783078

30793079
# If systemd-nspawn is used, O_SYNC flag will immediately
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix tests failing on FreeBSD in test.support's
2+
in_systemd_nspawn_sync_suppressed() due to unreadable /run directory.

0 commit comments

Comments
 (0)