fixed not closing file handle in pylint