Adds the logfile

I do agree with that, when you have a complex teardown that must be repeated more than one, for  a webapp one a database connection, using with makes sense. For files, I'm afraid I'll just get used to not write close statements, and begin to forget about them even while not writing python.