New submission from Yu Liu <>:

Given the following directory structure on a Windows machine:
- foo
 - bar

a call to `shutil.rmtree("foo")` will fail when the inner folder `bar` is 
opened in an Explorer. The error message indicates the `foo` directory is not 
empty, while after the execution, although it failed, the `foo` directory is 
empty. So the inner folder `bar` was removed successfully, but `foo` was not. 
And the error message is misleading.

It will not fail when `foo` is opened in an Explorer, neither on Linux system.

components: Library (Lib), Windows
messages: 315077
nosy: giampaolo.rodola, paul.moore, philius, steve.dower, tarek, tim.golden, 
priority: normal
severity: normal
status: open
title: shutil.rmtree fails when the inner floder is opened in Explorer on 
type: behavior
versions: Python 3.6

Python tracker <>
Python-bugs-list mailing list

Reply via email to