You might consider adding a doc block or just changing to name of "config_file" to clarify that this expects a path as a string, not a file object as the name might imply.