You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shutil.rmtree() cannot remove directory trees deeper than MAX_PATH on Windows #159681
3.14bugs and security fixes3.15bugs and security fixes3.16new features, bugs and security fixesOS-windowsstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
On Windows, shutil.rmtree() uses the path-based implementation, which builds the full path of every file and directory. Unless long paths are enabled in the registry (LongPathsEnabled, off by default), paths longer than MAX_PATH (260 characters) cannot be accessed. os.walk() ignores the resulting FileNotFoundError, so the deep part of the tree is silently skipped, and rmtree() then fails with "The directory is not empty".
3.14bugs and security fixes3.15bugs and security fixes3.16new features, bugs and security fixesOS-windowsstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
Activity