https://github.com/python/cpython/commit/314e753c084ebcf6a1b311d64f5aff0547eef10a
commit: 314e753c084ebcf6a1b311d64f5aff0547eef10a
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-22T09:36:14Z
summary:

[3.15] gh-154437: Fix test_getcwd_long_path on DragonFly BSD (GH-154438) 
(GH-154454)

DragonFly BSD raises EFAULT instead of ENAMETOOLONG when the path
exceeds PATH_MAX.
(cherry picked from commit 1bf86c134a5260876ad31fb32b832cbea24c21ad)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Lib/test/test_os/test_os.py

diff --git a/Lib/test/test_os/test_os.py b/Lib/test/test_os/test_os.py
index f9919e824b1abe..c6d20447086ae4 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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to