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

ENH: Support separate connect/read timeouts and timeout None in pylinkahead.ini

parent 6f276cc8
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 #58637 failed
......@@ -33,9 +33,10 @@ try:
# Adapted from https://github.com/python-jsonschema/jsonschema/issues/148
# Defines Validator to allow parsing of all iterables as array in jsonschema
# CustomValidator can be removed if/once jsonschema allows tuples for arrays
from collections.abc import Iterable
from jsonschema import validators
default = validators._LATEST_VERSION
default = validators.validator_for(True) # Returns latest supported draft
t_c = (default.TYPE_CHECKER.redefine('array', lambda x, y: isinstance(y, Iterable)))
CustomValidator = validators.extend(default, type_checker=t_c)
except ImportError:
......@@ -86,7 +87,9 @@ def config_to_yaml(config: ConfigParser) -> dict[str, dict[str, Union[int, str,
valobj[s] = {}
for key, value in config[s].items():
# TODO: Can the type be inferred from the config object?
if key in ["timeout", "debug"]:
if key in ["debug"]:
valobj[s][key] = int(value)
if key in ["timeout"]:
if str(value).lower() in ["none", "null"]:
valobj[s][key] = None
elif value.startswith('(') and value.endswith(')'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment