One function

load_config in pycqa/flake8

The author described this change as Raise exception if append-config does not exist. It counts as a record because the check below fails on the code as it stood at ad1006e8c and passes on 314b9f516, with nothing else changed between the two runs.

Fix saved2022-11-08
Sharing licenceMIT · LICENSE
Change size+4 1

What the code was meant to do, written into the code itself as a docstring

Load the configuration given the user options. - in `isolated` mode, return an empty configuration - if a config file is given in `config` use that, otherwise attempt to discover a configuration using `tox.ini` / `setup.cfg` / `.flake8` - finally, load any `extra` configuration files

The change

3232 # TODO: remove this and replace it with configuration modifying plugins
3333 # read the additional configs afterwards
3434 for filename in extra:
35- cfg.read(filename, encoding="UTF-8")
35+ if not cfg.read(filename, encoding="UTF-8"):
36+ raise exceptions.ExecutionError(
37+ f"The specified config file does not exist: {filename}"
38+ )
3639
3740 return cfg, cfg_dir

The check that tells the two apart

failpass·tests/unit/test_options_config.py::test_load_config_missing_append_config_raise_exception

Check file tests/unit/test_options_config.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itad1006e8cb4494b496ae301a19d68d1565d06f8e
Broken version dated2022-11-07
Moduleflake8.options.config
Units changedload_config
Fingerprint5dec7bf131958e25
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in pycqa/flake8