Skip to content
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

Arguments defined as booleans (ActionYesNo) cannot be set with environment variables #49

Closed
didirus opened this issue Mar 22, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@didirus
Copy link

didirus commented Mar 22, 2021

The code to reproduce is:

from jsonargparse import ArgumentParser, ActionYesNo
p = ArgumentParser(default_env=True, env_prefix='APP')
p.add_argument('--op', action=ActionYesNo, default=False)
print(p.parse_env({'APP_OP': 'true'}))

When running this gives as error:

usage: issue.py [-h] [--print_config [skip_null]] [--op]
issue.py: error: Value not boolean: ['true'].
@didirus didirus added the bug Something isn't working label Mar 22, 2021
mauvilsa added a commit that referenced this issue Mar 22, 2021
…e exists #48.

- Fixed ActionYesNo arguments failing when parsing from environment variable #49.
@mauvilsa
Copy link
Member

Fixed in v3.8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants