Should this be in a `try...except` block to ensure the file is closed even if something fails?