-
Notifications
You must be signed in to change notification settings - Fork 151
Description
What's the issue:
Some of the configurable knobs don't actually have a fallback value defined even though the documentation explicitly states these values do have a default. Case in point, let's take a gander at the [mirror].timeout
value -- it's documented as having a default of 10 seconds:
The default value for this setting is 10 seconds.
https://bandersnatch.readthedocs.io/en/latest/mirror_configuration.html#timeout
buttt looking at the source code it actually doesn't have one:
bandersnatch/src/bandersnatch/mirror.py
Lines 1012 to 1014 in 3b78e04
mirror_url = config.get("mirror", "master") | |
timeout = config.getfloat("mirror", "timeout") | |
global_timeout = config.getfloat("mirror", "global-timeout", fallback=None) |
Potential solutions:
- Fix the lack of
fallback=$val
for all of the options that are documented having a default - Fix the documentation to avoid stating these options have a default
I personally prefer the first one since having defaults makes sense so fixing the code to actually implement them is a good idea ... although this is a good opportunity to do a configuration adiut and see if any options shouldn't exist / or have a default / should have their default changed.
Additional context:
I was notified of this issue from a quick exchange in the Python Discord server: https://discord.com/channels/267624335836053506/463035462760792066/877942046952947722