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
argparse_flags.ArgumentParser does not accept --flagfile if there are no flags #199
Comments
Thanks for the bug report and analysis! You are right, the code should check |
Hi @yilei are there any updates? |
@jacky8hyf Thanks for the ping! I picked this up again now. |
copybara-service bot
pushed a commit
that referenced
this issue
Oct 31, 2023
…`None` instead of implicit bool. The documented contract is to skip absl flags when `inherited_absl_flags` is passed `None`. A `FlagValues` instance without any flags evaluates to `False` and shouldn't let it skip. PiperOrigin-RevId: 578025536
copybara-service bot
pushed a commit
that referenced
this issue
Oct 31, 2023
…`None` instead of implicit bool. The documented contract is to skip absl flags when `inherited_absl_flags` is passed `None`. A `FlagValues` instance without any flags evaluates to `False` and shouldn't let it skip. PiperOrigin-RevId: 578025536
copybara-service bot
pushed a commit
that referenced
this issue
Oct 31, 2023
…`None` instead of implicit bool. The documented contract is to skip absl flags when `inherited_absl_flags` is passed `None`. A `FlagValues` instance without any flags evaluates to `False` and shouldn't let it skip. PiperOrigin-RevId: 578025536
copybara-service bot
pushed a commit
that referenced
this issue
Oct 31, 2023
…`None` instead of implicit bool. The documented contract is to skip absl flags when `inherited_absl_flags` is passed `None`. A `FlagValues` instance without any flags evaluates to `False` and shouldn't let it skip. PiperOrigin-RevId: 578025536
copybara-service bot
pushed a commit
that referenced
this issue
Oct 31, 2023
…`None` instead of implicit bool. The documented contract is to skip absl flags when `inherited_absl_flags` is passed `None`. A `FlagValues` instance without any flags evaluates to `False` and shouldn't let it skip. PiperOrigin-RevId: 578025536
copybara-service bot
pushed a commit
that referenced
this issue
Oct 31, 2023
…ne` instead of implicit bool. The documented contract is to skip absl flags when `inherited_absl_flags` is passed `None`. A `FlagValues` instance without any flags evaluates to `False` and shouldn't let it skip. PiperOrigin-RevId: 578025536
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimum repro:
The error is:
The command would work if I uncomment line A.
It appears that ArgumentParser only accepts --flagfile if there are some
DEFINE_
'd strings. This is because of this line:https://github.com/abseil/abseil-py/blob/main/absl/flags/argparse_flags.py#L156
--flagfile is only accepted if
bool(self._inherited_absl_flags)
, which isFalse
if there are noDEFINE_
d strings.The text was updated successfully, but these errors were encountered: