You can use the with
statement to open the file, which will ensure that the file is closed.
with open('/some/file', 'rb') as f:
parser = ParserClasss(f)
return list(parser.info())
See http://www.python.org/dev/peps/pep-0343/ for more details.