wkentaro / gdown

Google Drive Public File Downloader when Curl/Wget Fails
MIT License
4.04k stars 343 forks source link

`download_folder` can return `False` which is not documented #315

Closed RunDevelopment closed 5 months ago

RunDevelopment commented 5 months ago

Provide environment information

Python 3.8.2 gdown: main

What OS are you using?

Windows 10

Describe the Bug

The return type of download_folder is documented as:

filenames: list of str
        List of files downloaded, or None if failed.

Ignoring that the stated type (list of str) and the documentation disagree, the documented type (list[str] | None) is not correct. The function can also return False via this code path.

Btw. the variable return_code isn't actually a return code, but a bool that describes whether gdrive_file is None.

Expected Behavior

Do what the docs say.

To Reproduce

No response

wkentaro commented 5 months ago

@RunDevelopment Yeah, I've just noticed this bug while working on this PR: https://github.com/wkentaro/gdown/pull/317/files#diff-d7515ef115e0aa06e22e4982677823eea6feba7594ba740388219f6206880484R277.

It's merged to main, and will be fixed in the next release.