Use a TemporaryFile for config

This helps on older pythons