[issue32847] Add DirectoryNotEmptyError subclass of OSError

STINNER Victor report at bugs.python.org
Thu Sep 12 05:49:49 EDT 2019


STINNER Victor <vstinner at python.org> 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 exactly 0 line of code in CPython code base which expects ENOTEMPTY errno. So it looks like an artifical use case.

I recall that when PEP 3151 was implemented, the implementation replaced a lot of code using "except OSError as exc: if exc.errno == XXX: ... else: raise" with "except : ..." which was neat.

But again, I don't see any usage of ENOTEMPTY in the Python stdlib.

Are you aware of 3rd party code expecting ENOTEMPTY? How many projects?

Adding a builtin symbol is a significant change, it should be well motived.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32847>
_______________________________________


More information about the Python-bugs-list mailing list