Skip to content

Commit 314e753

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[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 1bf86c1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 074a365 commit 314e753

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/test/test_os/test_os.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ def test_getcwd_long_path(self):
156156
# ("The filename or extension is too long")
157157
break
158158
except OSError as exc:
159-
if exc.errno == errno.ENAMETOOLONG:
159+
# DragonFly BSD raises EFAULT for a too long path.
160+
if exc.errno in (errno.ENAMETOOLONG, errno.EFAULT):
160161
break
161162
else:
162163
raise

0 commit comments

Comments
 (0)