[issue32847] Add DirectoryNotEmptyError subclass of OSError

2019-09-12 Thread STINNER Victor
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 e

[issue32847] Add DirectoryNotEmptyError subclass of OSError

2019-09-12 Thread STINNER Victor
STINNER Victor added the comment: Copy of my comment on the review: https://github.com/python/cpython/pull/15496#pullrequestreview-287311626 I'm not excited by adding a new builtin symbol: IMHO this module already exists too many symbols. I'm not convinced that it's worth it. There is exactl

[issue32847] Add DirectoryNotEmptyError subclass of OSError

2019-08-29 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- nosy: +nanjekyejoannah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue32847] Add DirectoryNotEmptyError subclass of OSError

2019-08-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: According to POSIX, the only system calls that can fail with ENOTEMPTY are rmdir(), rename() and unlinkat(). -- ___ Python tracker ___ _

[issue32847] Add DirectoryNotEmptyError subclass of OSError

2019-08-29 Thread Eryk Sun
Eryk Sun added the comment: > I have no opinion about "errno 39 (Directory not empty)". > Is it a "common" error? Python's code base never specifically handles ENOTEMPTY. On the other hand, in terms of basic operations on files and directories, I think implementing DirectoryNotEmptyError fo

[issue32847] Add DirectoryNotEmptyError subclass of OSError

2019-08-29 Thread STINNER Victor
STINNER Victor added the comment: > Maybe we should add one? I don't think that we need to add an *builtin* exception for every single possible errno. On Linux with Python 3.7, I count 133 different error numbers: >>> len([name for name in dir(errno) if name.startswith("E")]) 133 PEP 3151 e

[issue32847] Add DirectoryNotEmptyError subclass of OSError

2019-08-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +pitrou versions: +Python 3.9 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue32847] Add DirectoryNotEmptyError subclass of OSError

2019-08-25 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- keywords: +patch pull_requests: +15186 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15496 ___ Python tracker ___

[issue32847] Add DirectoryNotEmptyError subclass of OSError

2018-02-14 Thread Barry A. Warsaw
New submission from Barry A. Warsaw : I just ran across errno 39 (Directory not empty) when using Path.rename(newdir) when newdir already existed and was not empty. I realized that OSError exceptions don't have a DirectoryNotEmptyError subclass. Maybe we should add one? Probably not importa