Skip to content
Snippets Groups Projects
Commit 99db34bb authored by I. Nüske's avatar I. Nüske
Browse files

MNT: More robust timeout parsing, update changelog

parent 74684a84
No related branches found
No related tags found
2 merge requests!175BUG: Request responses without the "Set-Cookie" header no longer overwrite the...,!167Separate connect/read timeouts in pylinkahead.ini
Pipeline #58645 passed
...@@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`auth_token` if new value is `None` `auth_token` if new value is `None`
* [#119](https://gitlab.com/linkahead/linkahead-pylib/-/issues/119) * [#119](https://gitlab.com/linkahead/linkahead-pylib/-/issues/119)
The diff returned by compare_entities now uses id instead of name as key if either property does not have a name The diff returned by compare_entities now uses id instead of name as key if either property does not have a name
* [#127](https://gitlab.com/linkahead/linkahead-pylib/-/issues/127)
pylinkahead.ini now supports None and tuples as values for the `timeout` keyword
### Security ### ### Security ###
......
...@@ -90,10 +90,12 @@ def config_to_yaml(config: ConfigParser) -> dict[str, dict[str, Union[int, str, ...@@ -90,10 +90,12 @@ def config_to_yaml(config: ConfigParser) -> dict[str, dict[str, Union[int, str,
if key in ["debug"]: if key in ["debug"]:
valobj[s][key] = int(value) valobj[s][key] = int(value)
elif key in ["timeout"]: elif key in ["timeout"]:
value = "".join(value.split()) # Remove whitespace
if str(value).lower() in ["none", "null"]: if str(value).lower() in ["none", "null"]:
valobj[s][key] = None valobj[s][key] = None
elif value.startswith('(') and value.endswith(')'): elif value.startswith('(') and value.endswith(')'):
content = [int(s) for s in value[1:-1].split(',')] content = [None if str(s).lower() in ["none", "null"] else int(s)
for s in value[1:-1].split(',')]
valobj[s][key] = tuple(content) valobj[s][key] = tuple(content)
else: else:
valobj[s][key] = int(value) valobj[s][key] = int(value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment