From 52aa7f589780f70def74c03cebb8cc7591190bdf Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 22 Jul 2026 10:19:34 +0300 Subject: [PATCH] gh-154437: Fix test_getcwd_long_path on DragonFly BSD DragonFly BSD raises EFAULT instead of ENAMETOOLONG when the path exceeds PATH_MAX. Co-Authored-By: Claude Opus 4.8 --- Lib/test/test_os/test_os.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_os/test_os.py b/Lib/test/test_os/test_os.py index b4310043b60178..67b035ef51fc0c 100644 --- a/Lib/test/test_os/test_os.py +++ b/Lib/test/test_os/test_os.py @@ -156,7 +156,8 @@ def test_getcwd_long_path(self): # ("The filename or extension is too long") break except OSError as exc: - if exc.errno == errno.ENAMETOOLONG: + # DragonFly BSD raises EFAULT for a too long path. + if exc.errno in (errno.ENAMETOOLONG, errno.EFAULT): break else: raise