From b7cff307003b8da9fc10e6c150e55a23900f3dfa Mon Sep 17 00:00:00 2001 From: Nick Begg Date: Tue, 21 Apr 2026 18:50:47 +0200 Subject: [PATCH 1/3] 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/3] 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. From 91195cb7dcd78c53214c6f1314751a53b96ea37a Mon Sep 17 00:00:00 2001 From: Nick Begg Date: Sat, 9 May 2026 17:34:31 +0200 Subject: [PATCH 3/3] gh-148841: unified to one case for fallocate() failures on *BSD --- Lib/test/test_os/test_posix.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Lib/test/test_os/test_posix.py b/Lib/test/test_os/test_posix.py index d2c8c3881423c8..8b168ef79572de 100644 --- a/Lib/test/test_os/test_posix.py +++ b/Lib/test/test_os/test_posix.py @@ -412,12 +412,10 @@ def test_posix_fallocate(self): # so skip Solaris-based since they are likely to have ZFS. # issue33655: Also ignore EINVAL on *BSD since ZFS is also # often used there. - 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", "freebsd")): - raise unittest.SkipTest("test may fail on FFS filesystems") + # gh-148841: unified to one case for EINVAL/EOPNOTSUPP on *BSD + if inst.errno in (errno.EINVAL, errno.EOPNOTSUPP) and sys.platform.startswith( + ('sunos', 'freebsd', 'openbsd', 'netbsd', 'gnukfreebsd')): + raise unittest.SkipTest("test may fail on ZFS / FFS filesystems") else: raise finally: