From b7cff307003b8da9fc10e6c150e55a23900f3dfa Mon Sep 17 00:00:00 2001 From: Nick Begg Date: Tue, 21 Apr 2026 18:50:47 +0200 Subject: [PATCH 1/2] gh-148841: Fix test_posix on FreeBSD 15 with zfs filesys Handle EOPNOTSUPP as well as EINVAL in this case. --- Lib/test/test_os/test_posix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_os/test_posix.py b/Lib/test/test_os/test_posix.py index 0e8495a4eff2ed..d2c8c3881423c8 100644 --- a/Lib/test/test_os/test_posix.py +++ b/Lib/test/test_os/test_posix.py @@ -415,7 +415,8 @@ def test_posix_fallocate(self): if inst.errno == errno.EINVAL and sys.platform.startswith( ('sunos', 'freebsd', 'openbsd', 'gnukfreebsd')): raise unittest.SkipTest("test may fail on ZFS filesystems") - elif inst.errno == errno.EOPNOTSUPP and sys.platform.startswith("netbsd"): + elif inst.errno == errno.EOPNOTSUPP and sys.platform.startswith( + ("netbsd", "freebsd")): raise unittest.SkipTest("test may fail on FFS filesystems") else: raise From 79f0f1ed0abccca86d5d896be32b337e4f019695 Mon Sep 17 00:00:00 2001 From: Nick Begg Date: Fri, 24 Apr 2026 02:12:50 +0200 Subject: [PATCH 2/2] add blurb --- .../next/Tests/2026-04-24-02-12-30.gh-issue-148841.34XIIP.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2026-04-24-02-12-30.gh-issue-148841.34XIIP.rst diff --git a/Misc/NEWS.d/next/Tests/2026-04-24-02-12-30.gh-issue-148841.34XIIP.rst b/Misc/NEWS.d/next/Tests/2026-04-24-02-12-30.gh-issue-148841.34XIIP.rst new file mode 100644 index 00000000000000..fe0b6fc1d6d5ff --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-04-24-02-12-30.gh-issue-148841.34XIIP.rst @@ -0,0 +1,2 @@ +When calling fallocate() on a zfs filesystem, FreeBSD 15 returns EOPNOTSUPP, +as NetBSD does. This is causing test_os to fail - Handle this case as well.