STINNER Victor <> added the comment:

> Python's code base never specifically handles ENOTEMPTY.

Right, so this use case looks artificial to me.

> On the other hand, in terms of basic operations on files and directories, I 
> think implementing DirectoryNotEmptyError follows naturally from the existing 
> set: FileNotFoundError, FileExistsError, NotADirectoryError, and 
> IsADirectoryError.

Again, I consider that we must not add one exception per errno, since the 
Python errno module contains 133 error codes on Linux. Many are very rare and 
don't deserve to add a new symbol to the builtins module.

I suggest to close this issue.

If later someone wants to get DirectoryNotEmptyError, please open a new issue 
with statistics of how many 3rd party projects use ENOTEMPTY.


Python tracker <>
Python-bugs-list mailing list

Reply via email to