diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7aebe336..9666ab94 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -12,6 +12,14 @@ The semantic versioning only considers the public API as described in paths are considered internals and can change in minor and patch releases. +v4.33.2 (2024-10-??) +-------------------- + +Fixed +^^^^^ +- Fix `parse_argv_item` to address the behavior change in `argparse` since Python 3.12.7 (`#591 `__). + + v4.33.1 (2024-09-26) -------------------- diff --git a/jsonargparse/_typehints.py b/jsonargparse/_typehints.py index 445026c3..22204f82 100644 --- a/jsonargparse/_typehints.py +++ b/jsonargparse/_typehints.py @@ -396,6 +396,8 @@ def parse_argv_item(arg_string): if typehint: if parse_optional_num_return == 4: return action, arg_base, sep, explicit_arg + elif parse_optional_num_return == 1: + return [(action, arg_base, sep, explicit_arg)] return action, arg_base, explicit_arg return None diff --git a/jsonargparse_tests/test_argcomplete.py b/jsonargparse_tests/test_argcomplete.py index 7c3a3a53..2fc6d0af 100644 --- a/jsonargparse_tests/test_argcomplete.py +++ b/jsonargparse_tests/test_argcomplete.py @@ -28,6 +28,12 @@ def skip_if_argcomplete_unavailable(): pytest.skip("argcomplete package is required") +@pytest.fixture(autouse=True) +def temporal_skip_if_ge_py3127(): + if sys.version_info[:3] >= (3, 12, 7): + pytest.skip("currently failing on python>=3.12.7 due to argparse breaking change") + + @contextmanager def mock_fdopen(): err = StringIO()