You should either use a `with` statement or explicitly call `f.close()` here.