Query module FileNotAlwaysClosed

name
File is not always closed
description
Opening a file without ensuring that it is always closed may cause resource leaks.
kind
problem
tags
efficiency correctness resources external/cwe/cwe-772
problem.severity
warning
sub-severity
high
precision
medium
id
py/file-not-closed

Imports

Predicates

file_not_closed_at_exception_exit
file_not_closed_at_scope_exit
opened_in_enter_closed_in_exit

Whether resource is opened and closed in in a matched pair of methods, either enter and exit or init and del