Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tempfile.TemporaryDirectory cleanup fails on DragonFly BSD for files with UF_NOUNLINK #154307

Description

@serhiy-storchaka

On DragonFly BSD, TemporaryDirectory.cleanup() fails to remove a directory containing files or directories with the UF_NOUNLINK flag set (as exercised by test.test_tempfile...test_cleanup_with_symlink_flags).

Unlike FreeBSD, DragonFly's unlink() on a UF_NOUNLINK file fails with EISDIR (IsADirectoryError) instead of EPERM. The cleanup's onexc handler only resets flags for PermissionError, so the IsADirectoryError propagates and the flags are never cleared:

IsADirectoryError: [Errno 21] Is a directory: '.../test0.txt'

Handling IsADirectoryError the same way as PermissionError fixes it. Related: gh-91133.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions