Open nutjob4life opened 11 months ago
macOS 13.4
In some deeply embedded code, an autonomous system calls
fd, fn = tempfile.mkstemp('.xlsx') os.close(fd) gdown.download(id=file_identifier, output=fn, quiet=True, use_cookies=False, format='xlsx')
and an unexpected error occurs later in the system when the supposedly downloaded file is read:
sheet = pandas.read_excel(fn)
with the error:
ValueError: Excel file format cannot be determined, you must specify an engine manually
The problem being that the file fn is actually empty. The real error is:
fn
Cannot retrieve the public link of the file. You may need to change the permission to 'Anyone with the link', or have had many accesses.
We expected gdown.download to raise an exception on error.
gdown.download
An exception to be raised on exceptional conditions.
Alternatively, the docstring should indicate how the return value is used to indicate exceptional conditions.
The workaround is to do what gdown.cli does: check the return value and if it's None, manually raise an exception.
gdown.cli
None
Otherwise, thanks so much for gdown! It's really quite superb otherwise 😇
gdown
I don't understand, there is no new release but I got this error today. I fixed it downgrading the version to 4.6.0.
It woked, Thank you @m-pektas
Provide environment information
What OS are you using?
macOS 13.4
Describe the Bug
In some deeply embedded code, an autonomous system calls
and an unexpected error occurs later in the system when the supposedly downloaded file is read:
with the error:
The problem being that the file
fn
is actually empty. The real error is:We expected
gdown.download
to raise an exception on error.Expected Behavior
An exception to be raised on exceptional conditions.
Alternatively, the docstring should indicate how the return value is used to indicate exceptional conditions.
To Reproduce
gdown.download
that fileThe workaround is to do what
gdown.cli
does: check the return value and if it'sNone
, manually raise an exception.Otherwise, thanks so much for
gdown
! It's really quite superb otherwise 😇