GH-95815: Document less specific error for os.remove#99571
GH-95815: Document less specific error for os.remove#99571ronaldoussoren merged 1 commit intopython:mainfrom
Conversation
os.remove can raise PermissionError instead of IsADirectoryError, when the object to be removed is a directory (in particular on macOS). This reverts a change done in python#14262.
|
This PR is the minimal change that makes the documentation reflect reality. An alternative would be to document that the function might raise either IsADirectoryError or PermissionError. I'm not sure which option would be the best fix. |
hauntsaninja
left a comment
There was a problem hiding this comment.
This looks good to me. Documenting the specific subclasses in this case doesn't seem particularly helpful and probably would just lead to people writing less portable code e.g. if they stop reading after seeing IsADirectoryError.
|
Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
|
Sorry @ronaldoussoren, I had trouble checking out the |
…99571) os.remove can raise PermissionError instead of IsADirectoryError, when the object to be removed is a directory (in particular on macOS). This reverts a change done in pythonGH-14262. (cherry picked from commit 1cae31d) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
|
GH-99639 is a backport of this pull request to the 3.10 branch. |
|
Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…99571) os.remove can raise PermissionError instead of IsADirectoryError, when the object to be removed is a directory (in particular on macOS). This reverts a change done in pythonGH-14262. (cherry picked from commit 1cae31d) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
|
GH-99641 is a backport of this pull request to the 3.11 branch. |
#99641) GH-95815: Document less specific error for os.remove (GH-99571) os.remove can raise PermissionError instead of IsADirectoryError, when the object to be removed is a directory (in particular on macOS). This reverts a change done in GH-14262. (cherry picked from commit 1cae31d) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
#99639) GH-95815: Document less specific error for os.remove (GH-99571) os.remove can raise PermissionError instead of IsADirectoryError, when the object to be removed is a directory (in particular on macOS). This reverts a change done in GH-14262. (cherry picked from commit 1cae31d) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
os.remove can raise PermissionError instead of IsADirectoryError, when the object to be removed is a directory (in particular on macOS).
This reverts a change done in #14262.