ConfigArgParse
ConfigArgParse copied to clipboard
Handle pathlib Path used as default_config_files
Having Path objects in the default_config_files make it impossible to display the help (-h) message
from pathlib import Path
import configargparse
p = configargparse.ArgumentParser(default_config_files=[Path("~/.my_settings.ini")])
p.add("geotiff")
p.add("--flag", help="Flag that can be set in the config file")
options = p.parse_args()
Running the above snippet with -h will trigger a TypeError: sequence item 0: expected str instance, PosixPath found.
This PR just casts the default_config_files to str in the help message.