You forgot to close the file. What about use `with`?