]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-154437: Fix test_getcwd_long_path on DragonFly BSD (GH-154438)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 22 Jul 2026 09:05:06 +0000 (12:05 +0300)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2026 09:05:06 +0000 (12:05 +0300)
DragonFly BSD raises EFAULT instead of ENAMETOOLONG when the path
exceeds PATH_MAX.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_os/test_os.py

index c62bceb25cabe05ca457703d7d21d0dda6354380..3e5ad52c4ab130d58c962a92087e1bc3334df41e 100644 (file)
@@ -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