From: Serhiy Storchaka Date: Wed, 22 Jul 2026 09:05:06 +0000 (+0300) Subject: gh-154437: Fix test_getcwd_long_path on DragonFly BSD (GH-154438) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=1bf86c134a5260876ad31fb32b832cbea24c21ad;p=thirdparty%2FPython%2Fcpython.git gh-154437: Fix test_getcwd_long_path on DragonFly BSD (GH-154438) DragonFly BSD raises EFAULT instead of ENAMETOOLONG when the path exceeds PATH_MAX. Co-authored-by: Claude Opus 4.8 --- diff --git a/Lib/test/test_os/test_os.py b/Lib/test/test_os/test_os.py index c62bceb25cab..3e5ad52c4ab1 100644 --- a/Lib/test/test_os/test_os.py +++ b/Lib/test/test_os/test_os.py @@ -156,7 +156,8 @@ class MiscTests(unittest.TestCase): # ("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