Skip to content

test.test_tempfile.TestTemporaryDirectory.test_flags fails on FreeBSD with /tmp on ZFS #91807

Closed
@emaste

Description

@emaste

Bug report

$ make test TESTOPTS="-v test_tempfile"
...
======================================================================
ERROR: test_flags (test.test_tempfile.TestTemporaryDirectory.test_flags)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/emaste/src/cpython/Lib/test/test_tempfile.py", line 1670, in test_flags
    os.chflags(os.path.join(root, name), flags)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 45] Operation not supported: '/tmp/brx0o39r/dir0/dir0/dir0/test1.txt'

----------------------------------------------------------------------
Ran 97 tests in 0.426s

FAILED (errors=1, skipped=1)
test test_tempfile failed

== Tests result: FAILURE ==

Your environment

cpython from git at ac4ffd3
FreeBSD main build Apr 21
/tmp is on ZFS root filesystem

in Lib/test/test_posix.py we have:

        # ZFS returns EOPNOTSUPP when attempting to set flag UF_IMMUTABLE.
        flags = st.st_flags | stat.UF_IMMUTABLE
        try:
            chflags_func(target_file, flags, **kwargs)
        except OSError as err:
            if err.errno != errno.EOPNOTSUPP:
                raise
            msg = 'chflag UF_IMMUTABLE not supported by underlying fs'
            self.skipTest(msg)

Lib/test/test_tempfile.py test_flags needs a similar treatment it seems

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions