]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-154437: Fix test_getcwd_long_path on DragonFly BSD (GH-154438) (GH-154454)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 22 Jul 2026 09:36:14 +0000 (11:36 +0200)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2026 09:36:14 +0000 (09:36 +0000)
DragonFly BSD raises EFAULT instead of ENAMETOOLONG when the path
exceeds PATH_MAX.
(cherry picked from commit 1bf86c134a5260876ad31fb32b832cbea24c21ad)

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

index f9919e824b1abe4991d33b7586b2fc0e70cc718d..c6d20447086ae45d1c4a66454e3883c15aefb65b 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