Skip to content

tarfile doesn't set file modes correctly on FreeBSD: test_tarfile.test_modes() fails on FreeBSD #108948

Closed
@sorcio

Description

@sorcio

Bug report

Bug description:

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)

CPython versions tested on:

3.12

Operating systems tested on:

Other

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-freebsdtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions