https://github.com/python/cpython/commit/d24978275ed9cbd7fbecae4d7dfa0e1e7f49c0c0
commit: d24978275ed9cbd7fbecae4d7dfa0e1e7f49c0c0
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-22T09:26:43Z
summary:

[3.13] gh-154437: Fix test_getcwd_long_path on DragonFly BSD (GH-154438) 
(GH-154456)

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.py

diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index e143dc35b581c5..b50590c7a28959 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -168,7 +168,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