Shouldn't this be `stream.close()`? Also, you should probably use the `with` idiom for this. Something like this:

```python
with open("...", "r"):
    config = ...
````

And you save up the close line since it's part of the with.