Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/tempfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,8 @@ def __init__(self, suffix=None, prefix=None, dir=None,
@classmethod
def _rmtree(cls, name, ignore_errors=False, repeated=False):
def onexc(func, path, exc):
if isinstance(exc, PermissionError):
# On DragonFly BSD, UF_NOUNLINK removal fails with EISDIR, not EPERM.
if isinstance(exc, (PermissionError, IsADirectoryError)):
if repeated and path == name:
if ignore_errors:
return
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix :meth:`tempfile.TemporaryDirectory.cleanup` on DragonFly BSD, where removing
a file with the ``UF_NOUNLINK`` flag failed with ``EISDIR`` instead of
``EPERM``.
Loading