Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xr.py check_config() doing a wrong type check #93

Open
oranima opened this issue Jul 5, 2023 · 0 comments
Open

xr.py check_config() doing a wrong type check #93

oranima opened this issue Jul 5, 2023 · 0 comments

Comments

@oranima
Copy link

oranima commented Jul 5, 2023

check_config() function in set_json() under xr.py contains some bugs.
see below what should be changed

    def check_configs(name, configs):

[-] if isinstance(name, string_types):
[+] if isinstance(configs, string_types):
...
[-] elif isinstance(name, dict):
[+] elif isinstance(configs, dict):

name is indeed always a string as the function is called with
lines 188,189
updates = create_updates("update_json_configs", update_json_configs)
replaces = create_updates("replace_json_configs", replace_json_configs)
line 155
configs = check_configs(name, configs)

The test should be checked against configs which it the variable containing the actual config and which should be either a string, a dict or an iterable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant