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.

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

320320 "app = Flask(__name__)\n"
321321 "FlaskDynaconf(app)\n"
322322 )
323- exit(1)
323+ sys.exit(1)
324324
325325 path = Path(path)
326326
650650
651651 if value is empty:
652652 click.secho("Key not found", bg="red", fg="white", err=True)
653- return
653+ sys.exit(1)
654654
655655 if not _json:
656656 click.echo(format_setting(key, value))

The check that tells the two apart

failpass·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