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

Actions fail with Python 3.12.7 but passed with 3.12.6 #231

Closed
dalito opened this issue Nov 1, 2024 · 0 comments · Fixed by #233
Closed

Actions fail with Python 3.12.7 but passed with 3.12.6 #231

dalito opened this issue Nov 1, 2024 · 0 comments · Fixed by #233
Assignees
Milestone

Comments

@dalito
Copy link
Member

dalito commented Nov 1, 2024

The error is raised during argument parsing:

----------------------------- Captured stderr call -----------------------------
usage: voc4cat docs [-h] [-v | -q] [--config CONFIG] [-O DIRECTORY]
                    [-l LOGFILE] [--style {p,y,l,o,d,e}] [--force]
                    VOCAB
voc4cat docs: error: argument --style: invalid choice: 'pylode' (choose from 'p', 'y', 'l', 'o', 'd', 'e')
_______________________________ test_build_docs ________________________________
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/argparse.py:1931: in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/argparse.py:2168: in _parse_known_args
    start_index = consume_optional(start_index)
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/argparse.py:2099: in consume_optional
    take_action(action, args, option_string)
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/argparse.py:1991: in take_action
    argument_values = self._get_values(action, argument_strings)
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/argparse.py:2536: in _get_values
    self._check_value(action, value)
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/argparse.py:2595: in _check_value
    raise ArgumentError(action, msg % args)
E   argparse.ArgumentError: argument --style: invalid choice: 'pylode' (choose from 'p', 'y', 'l', 'o', 'd', 'e')

Did argparse change?
Yes, there were several changes: https://docs.python.org/release/3.12.7/whatsnew/changelog.html#python-3-12-7
Most likely, the error is due to stricter handling of choices: python/cpython#124578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant