FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-95815: Document less specific error for os.remove by ronaldoussoren · Pull Request #99571 · python/cpython · GitHub

/ cpython Public

GH-95815: Document less specific error for os.remove - #99571

Merged
ronaldoussoren merged 1 commit into
python:mainfrom
ronaldoussoren:gh95815-os.remove-docs
Nov 21, 2022
Merged

GH-95815: Document less specific error for os.remove#99571
ronaldoussoren merged 1 commit into
python:mainfrom
ronaldoussoren:gh95815-os.remove-docs

Conversation

ronaldoussoren commented Nov 18, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

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.

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.

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

ronaldoussoren merged commit 1cae31d into python:main Nov 21, 2022

Copy link
Copy Markdown
Contributor

Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

Copy link
Copy Markdown
Contributor

Sorry @ronaldoussoren, I had trouble checking out the 3.11 backport branch.
Please retry by removing and re-adding the "needs backport to 3.11" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker 1cae31d26ba621f6b1f0656ad3d69a0236338bad 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 21, 2022
…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>

Copy link
Copy Markdown

GH-99639 is a backport of this pull request to the 3.10 branch.

bedevere-bot removed the needs backport to 3.10 only security fixes label Nov 21, 2022
ronaldoussoren added 3.11 only security fixes needs backport to 3.11 only security fixes and removed needs backport to 3.11 only security fixes 3.11 only security fixes labels Nov 21, 2022

Copy link
Copy Markdown
Contributor

Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 21, 2022
…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>

Copy link
Copy Markdown

GH-99641 is a backport of this pull request to the 3.11 branch.

bedevere-bot removed the needs backport to 3.11 only security fixes label Nov 21, 2022
ronaldoussoren added a commit that referenced this pull request Nov 21, 2022
#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>
ronaldoussoren added a commit that referenced this pull request Nov 21, 2022
#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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL