-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with argparse.BooleanOptionalAction #245
Comments
Sorry about the remaining issue(s). I'm not sure when I'll be able to work on this. In the mean time, a PR to fix it would be appreciated. |
Hello @bw2, I have just sent a PR that fix the second part of this issue (the reading from config file). The problem that the default arguments are not saved in the config file is still there, but for this problem it might be better to open a separate issue, because I see that this problem is not related only to action=BooleanOptionalAction but also to action = " store_true ". I think that perhaps the _writing_out_config_file function was designed like that (do not save the default arguments). |
Close the issue after merging #248 |
Following #239, I just tested the new release (ConfigArgParse 1.5.2), using the same code reported in #239: now there is not the error reported in #239 (thanks!), but the functionality is not as I expected.
The issues are:
False
is not taken into consideration and the config.conf is empty:$ python boolean_optional_action_test.py --generate_config_file config.conf --foo Wrote config file to config.conf $ cat config.conf foo = true
the config file correctly contains some info about foo (true), but this is not readable from the parser, in fact parsing this config file return the default foo = False and not the True value contained in the file:
python boolean_optional_action_test.py --config_file config.conf Namespace(config_file='config.conf', write_out_config_file_to_this_path=None, foo=False)
Any idea of how to manage that?
The text was updated successfully, but these errors were encountered: