You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most file IO should be using with statements to automatically close files, but there still may be instances of manual open and close calls (or lack thereof). See Reading and Writing Files.
My first idea for an implementation is tracking variable instantiation of the above methods, then checking for a lack of a close call in the same scope.
Also would be good to check for a lack of closing a connection after opening one (e.g. in SQLAlchemy). There's probably lots of opportunity for this in DB connection libraries.
The text was updated successfully, but these errors were encountered:
Most file IO should be using
with
statements to automatically close files, but there still may be instances of manualopen
andclose
calls (or lack thereof). See Reading and Writing Files.There are lots of ways a file can be opened:
open
os.open
io.open
(alias for builtinopen
)tempfile.TemporaryFile|NamedTemporaryFile|SpooledTemporaryFile
tarfile.open
ZipFile.open
My first idea for an implementation is tracking variable instantiation of the above methods, then checking for a lack of a
close
call in the same scope.Also would be good to check for a lack of closing a connection after opening one (e.g. in SQLAlchemy). There's probably lots of opportunity for this in DB connection libraries.
The text was updated successfully, but these errors were encountered: