What does the context manager do when you are opening a file using with?