Please use `with` context manager when opening and reading a file (e.g. https://github.com/apache/libcloud/blob/trunk/libcloud/compute/deployment.py#L188).

This way you can be sure file is always closed (even if the exception happens) and you don't need to manually wrap it in `try / except / finally` block and make sure you always close file in the `finally` block.