Instead of stripping out the `{` why not just do `if line.startswith("{path_config_bindir,"):`?