Skip to content

Better communicate that IOError and WindowsError are just aliases of OSError now #110497

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

Closed
sobolevn opened this issue Oct 7, 2023 · 1 comment
Assignees
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Oct 7, 2023

Bug report

While working on some Windows-related typeshed PRs, I've noticed that some places in docs are very clear about this change. For example:

.. versionchanged:: 3.3
   :exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`.

It is clear that OSError is the same as IOError now.

But, there are several places where it is not clear. Example:

If no :file:`.mo` file is found, this function raises :exc:`OSError` if
*fallback* is false (which is the default), and returns a
:class:`NullTranslations` instance if *fallback* is true.
.. versionchanged:: 3.3
:exc:`IOError` used to be raised instead of :exc:`OSError`.

It might be confusing: people might think that right now OSError and IOError are different.
Let's add notes about explicit alias to several places that miss it.

Linked PRs

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error docs Documentation in the Doc dir labels Oct 7, 2023
@sobolevn sobolevn self-assigned this Oct 7, 2023
sobolevn added a commit to sobolevn/cpython that referenced this issue Oct 7, 2023
@nanjekyejoannah
Copy link
Contributor

Closing because PR is merged.

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 9, 2023
… in docs (pythonGH-110498)

(cherry picked from commit 5e7edac)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 9, 2023
… in docs (pythonGH-110498)

(cherry picked from commit 5e7edac)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
nanjekyejoannah pushed a commit that referenced this issue Oct 9, 2023
…` in docs (GH-110498) (#110545)

gh-110497: Add note about `OSError` being an alias to `IOError` in docs (GH-110498)
(cherry picked from commit 5e7edac)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
nanjekyejoannah pushed a commit that referenced this issue Oct 9, 2023
…` in docs (GH-110498) (#110546)

gh-110497: Add note about `OSError` being an alias to `IOError` in docs (GH-110498)
(cherry picked from commit 5e7edac)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
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 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants