Whole file
dynaconf/dynaconf
The author described this change as “fix: `-k` must exit code 1 when key do not exist (#1293)”. It counts as a record because the check below fails on the code as it stood at 934a8f833 and passes on 82a3f61d1, with nothing else changed between the two runs.
Projectdynaconf/dynaconf
Fix saved2025-05-06
Sharing licenceMIT · LICENSE
Change size+2 −2
What the code was meant to do, written into the code itself as a save note
fix: `-k` must exit code 1 when key do not exist (#1293)
The change
| 320 | 320 | "app = Flask(__name__)\n" | |
| 321 | 321 | "FlaskDynaconf(app)\n" | |
| 322 | 322 | ) | |
| 323 | - | exit(1) | |
| 323 | + | sys.exit(1) | |
| 324 | 324 | ||
| 325 | 325 | path = Path(path) | |
| 326 | 326 | ||
| ⋯ | |||
| 650 | 650 | ||
| 651 | 651 | if value is empty: | |
| 652 | 652 | click.secho("Key not found", bg="red", fg="white", err=True) | |
| 653 | - | return | |
| 653 | + | sys.exit(1) | |
| 654 | 654 | ||
| 655 | 655 | if not _json: | |
| 656 | 656 | click.echo(format_setting(key, value)) | |
The check that tells the two apart
fail→pass·tests/test_cli.py::test_not_found_key_exit_error[list]
Check file tests/test_cli.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 it934a8f833bd2a9648d7bbb0174a00c83f8577675
Broken version dated2025-05-06
Moduledynaconf.cli
Units changed_list, init
Fingerprintaf98119f4a4c88ae
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 dynaconf/dynaconf
- 2026-08-05find_the_correct_casing
- 2026-08-01get_history
- 2026-07-31fix: add __deepcopy__ to DataDict to match DataList (#1440)
- 2026-07-29normalize_kwargs
- 2026-07-29handle_metavalues
- 2026-07-29object_merge