Use with statement when opening files to have more predictable behavior when the file closes