-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-95815: Document less specific error for os.remove #99571
GH-95815: Document less specific error for os.remove #99571
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.