Python typically closes files on exit but there is the potential for leaving a file open if we don't handle exits appropriately. The Pythonic way to handle this is with a context manager.
We should review every instance where a file is opened and make sure that the with keyword is being used so that when the scope is left, the file is closed.
Python typically closes files on exit but there is the potential for leaving a file open if we don't handle exits appropriately. The Pythonic way to handle this is with a context manager.
We should review every instance where a file is opened and make sure that the
with
keyword is being used so that when the scope is left, the file is closed.