Skip to content

Commit 52aa7f5

Browse files
gh-154437: Fix test_getcwd_long_path on DragonFly BSD
DragonFly BSD raises EFAULT instead of ENAMETOOLONG when the path exceeds PATH_MAX. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 458367e commit 52aa7f5

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)