From 564f7f8aefc59e88e9ab7ab30cc229010ea5452c Mon Sep 17 00:00:00 2001 From: Zo Bot Date: Fri, 12 Jun 2026 13:50:26 +0000 Subject: [PATCH] skip config options that are no longer registered with the active OptionManager --- src/flake8/options/aggregator.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/flake8/options/aggregator.py b/src/flake8/options/aggregator.py index 999161a..681ee27 100644 --- a/src/flake8/options/aggregator.py +++ b/src/flake8/options/aggregator.py @@ -39,8 +39,25 @@ def aggregate_options( # If the config name is somehow different from the destination name, # fetch the destination name from our Option if not hasattr(default_values, config_name): - dest_val = manager.config_options_dict[config_name].dest - assert isinstance(dest_val, str) + try: + option = manager.config_options_dict[config_name] + except KeyError: + LOG.warning( + 'Config option "%s" is not registered with the active ' + "OptionManager; ignoring value %r", + config_name, + value, + ) + continue + dest_val = option.dest + if not isinstance(dest_val, str): + LOG.warning( + 'Config option "%s" has no explicit "dest" attribute; ' + "ignoring value %r", + config_name, + value, + ) + continue dest_name = dest_val LOG.debug(