Skip to content
Prev Previous commit
Next Next commit
Restore comment.
  • Loading branch information
barneygale committed May 30, 2024
commit 4daf2f20a5922230eab6b970a8103f9c6982f0e9
1 change: 1 addition & 0 deletions Lib/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ def _rmtree_safe_fd(stack, onexc):
func = os.path.islink # For error reporting.
try:
if not os.path.samestat(orig_st, os.fstat(fd)):
# Symlinks to directories are forbidden, see GH-46010.
raise OSError("Cannot call rmtree on a symbolic link")
stack.append((os.rmdir, dir_fd, path, orig_entry))
finally:
Expand Down