python-tuf icon indicating copy to clipboard operation
python-tuf copied to clipboard

The client-example has a confusing return for the `download` function.

Open kairoaraujo opened this issue 3 years ago • 2 comments

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.

kairoaraujo avatar Jul 14 '22 09:07 kairoaraujo

Thread in Slack channel: https://cloud-native.slack.com/archives/C01GT17AC5D/p1657718611407839

kairoaraujo avatar Jul 14 '22 09:07 kairoaraujo

I think this may get fixed in #2193

jku avatar Dec 02 '22 12:12 jku