bw2 / ConfigArgParse

A drop-in replacement for argparse that allows options to also be set via config files and/or environment variables.
MIT License
722 stars 121 forks source link

YAMLConfigFileParser: null values are parsed as "None" instead of None #198

Closed trougnouf closed 3 years ago

trougnouf commented 3 years ago

null values contained in a yaml config file are parsed as the "None" string instead of None. This happens when I load a saved configuration with YAMLConfigFileParser and some values are not set.

I suspect this is set in lines 300-304:

        for key, value in parsed_obj.items():
            if isinstance(value, list):
                result[key] = value
            else:
                result[key] = str(value)