python-tuf
python-tuf copied to clipboard
The client-example has a confusing return for the `download` function.
Description of issue:
The client-example has a confusing return for the download function.
The return mixes the error and flows handling.
Current behavior: Currently, it returns a bool.
- If a target file is downloaded it returns True
- If there is an exception in the code it returns False
- if a target file is not found it returns True
https://github.com/theupdateframework/python-tuf/blob/c12be4857d5388eb8e3c2e692fa6cce4f95cff35/examples/client_example/client_example.py#L78
Expected behavior: The return code only manages the exceptions. However, there is no use for the current return.
Thread in Slack channel: https://cloud-native.slack.com/archives/C01GT17AC5D/p1657718611407839
I think this may get fixed in #2193