From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 22 Jul 2026 09:26:43 +0000 (+0200) Subject: [3.13] gh-154437: Fix test_getcwd_long_path on DragonFly BSD (GH-154438) (GH-154456) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d24978275ed9cbd7fbecae4d7dfa0e1e7f49c0c0;p=thirdparty%2FPython%2Fcpython.git [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 Co-authored-by: Claude Opus 4.8 --- diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index e143dc35b581..b50590c7a289 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -168,7 +168,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