From b88085cf06c21c4e7005b1337ba76ce9dee45e10 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 20 Jul 2026 11:11:53 +0300 Subject: [PATCH] gh-154218: Fix test_posix_fallocate on file systems that do not support posix_fallocate() (GH-154219) (cherry picked from commit 051b6e07f9e43980d99c563d67bea32144238461) Co-authored-by: Serhiy Storchaka Co-authored-by: Claude Fable 5 --- Lib/test/test_posix.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 31657bdc9d4476..282418e27e5b57 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -415,8 +415,10 @@ 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"): - raise unittest.SkipTest("test may fail on FFS filesystems") + elif inst.errno == errno.EOPNOTSUPP: + # ZFS on FreeBSD, FFS on NetBSD, etc. + raise unittest.SkipTest( + "the file system does not support posix_fallocate()") else: raise finally: