You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tarfile doesn't set file modes correctly on FreeBSD: test_tarfile.test_modes() fails on FreeBSD #108948
The best example for this is given in the regression test suite. TestExtractionFilters.test_modes in test_tarfiles fails with OSError: [Errno 79] Inappropriate file type or format on FreeBSD.
The reason is that chmod fails with EFTYPE (errno 79) when attempting to set the sticky bit (S_ISVTX) on a file when the effective user is not root. Most other platforms will just ignore the bit in chmod calls.
Tested on FreeBSD 13.2 but documentation suggests this is not a new behavior.
(Note that FreeBSD buildbots haven't been running for a while. This is probably why this issue, although it causes a test failure, hadn't been caught before)
changed the title [-]tarfile doesn't set file modes correctly on FreeBSD[/-][+]tarfile doesn't set file modes correctly on FreeBSD: test_tarfile.test_modes() fails on FreeBSD[/+]on Sep 14, 2023
On further assessment (thanks @encukou), this could be solely a tests issue, and not a library bug. Maybe it's okay that tarfile has different behaviors on different OSes, especially around exotic cases, and it's enough to relax the expectation in the failing test.
Activity
[-]tarfile doesn't set file modes correctly on FreeBSD[/-][+]tarfile doesn't set file modes correctly on FreeBSD: test_tarfile.test_modes() fails on FreeBSD[/+]sorcio commentedon Sep 18, 2023
On further assessment (thanks @encukou), this could be solely a tests issue, and not a library bug. Maybe it's okay that tarfile has different behaviors on different OSes, especially around exotic cases, and it's enough to relax the expectation in the failing test.
pythongh-108948: Skip test_tarfile.test_modes() on EFTYPE error
pythongh-108948: Skip test_tarfile.test_modes() on EFTYPE error
pythongh-108948: Skip test_tarfile.test_modes() on EFTYPE error
gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697)
pythongh-108948: Skip test_tarfile.test_modes() on EFTYPE error (pyth…
[3.11] gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#10…
vstinner commentedon Sep 22, 2023
Fixed by skipping the test if chmod() cannot set the sticky bit.
See #108950 (comment) for the longer rationale.
pythongh-108948: Skip test_tarfile.test_modes() on EFTYPE error (pyth…
[3.12] gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#10…
pythongh-108948: Skip test_tarfile.test_modes() on EFTYPE error (pyth…
pythongh-108948: Skip test_tarfile.test_modes() on EFTYPE error (pyth…
pythongh-108948: Skip test_tarfile.test_modes() on EFTYPE error (pyth…
[3.10] gh-107902: gh-108948: Don't test setting suid/sgid/sticky on s…
[3.10] pythongh-107902: pythongh-108948: Don't test setting suid/sgid…
[3.9] gh-107902: gh-108948: Don't test setting suid/sgid/sticky on sy…