We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In Ruff version 0.7.3, SIM115 is not recognized in a case that was recognized in 0.7.2:
0.7.3
SIM115
0.7.2
file.py
from __future__ import annotations import traceback from typing import Any, IO def open_file( filename: str, mode: str, encoding: str | None = None, ) -> IO[Any] | None: """Return file handle. Return None on failure.""" try: # Line below previously correctly triggered `SIM115` return open(filename, mode, encoding=encoding) except FileNotFoundError: print("File Not Found.") except (OSError, BaseException) as exc: print(exc) traceback.print_exception(exc) return None
Noted line no longer triggers SIM115, where I argue it might be more correct to do so.
ruff check --isolated --select=SIM115 file.py
~ > ruff --version ruff 0.7.3
The text was updated successfully, but these errors were encountered:
I believe this was an intentional change.
Sorry, something went wrong.
Yes, per #14066 and #13862
The caller could context manage the returned object. It is incorrect to raise SIM115 here.
Alright, that makes sense, thanks for clarifying!
No branches or pull requests
In Ruff version
0.7.3
,SIM115
is not recognized in a case that was recognized in0.7.2
:file.py
Noted line no longer triggers
SIM115
, where I argue it might be more correct to do so.The text was updated successfully, but these errors were encountered: