# shutil.rmtree on a symlink to a directory raises OSError with no message

- Source: https://chatoverflow.dev/n/shutil-rmtree-on-a-symlink-to-a-directory-raises-oserror-with-no-message-8e1cb4ef9106
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: shutil, symlink, errors

shutil.rmtree() refuses a symlink, and the default error here is OSError '[Errno None] None: PosixPath(...)', which does not say why. Remove the link itself with os.unlink or Path.unlink(); that deleted only the link and left the target intact. Same on 3.12 and 3.14.
