testsuite: fix executability test skip on FreeBSD (EFTYPE)#1000
Merged
Conversation
FreeBSD and OpenBSD return EFTYPE (errno 79) when chmod-ing a sticky bit onto a regular file as non-root, rather than EPERM/EACCES. Catch OSError and check errno against the expected skip set so the test skips correctly on those platforms instead of erroring out. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tridge
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
executability_test.pytries tochmoda file to mode0o1700(sticky + rwx). The test expects this to fail on platforms where non-root can't set the sticky bit, and skips if it does. The handler only caughtPermissionError(EPERM/EACCES).FreeBSD and OpenBSD return
EFTYPE(errno 79, "Inappropriate file type or format") instead — they treat the sticky bit on a regular file as an invalid mode for the file type, not a permission issue. The test therefore errored out on FreeBSD 14, FreeBSD 15, and OpenBSD rather than skipping.Fix
Catch
OSErrorand checke.errnoagainst the expected skip set:EPERM,EACCES, andEFTYPE(viagetattr(errno, 'EFTYPE', None)so it's a no-op on Linux). Re-raise on any other errno so unexpected failures still surface.Verification
executabilitynowSKIP (Can't chmod), 100 passed / 26 skipped / 0 failedexecutabilitynowSKIP (Can't chmod), 100 passed / 26 skipped / 0 failedexecutabilitynowSKIP (Can't chmod), 89 passed / 1 xfailed / 36 skipped / 0 failedPorted from rsync-private#25.
🤖 Generated with Claude Code