Conversation
| return True | ||
| elif env_value == "false": | ||
| return False | ||
| return None |
There was a problem hiding this comment.
This looks strange, how debug could be non-True and non-False in the same time.
Why not simply decide if debug is True or False, right here?
Also, just recommendation: consider checking "0" and "1", "False" and "True" as well.
Another approach is strict check - if env_value is non-empty and neither "true" nor "false" then raise an error with message that env variable is set to strange value
There was a problem hiding this comment.
The debug environment variable can be set and it can have correct value, such as "true" and "false", incorrect value, or can be not set at all. Also, the default value is determined later in the code.
However, I agree that a validation have to be done in this function instead of silently hide all incorrect values and return None as though they are not set. I will fix it in the next patches.
No description provided.