Open aeltanawy opened 3 years ago
What happens if you don't specify its mimetype?
What happens if you don't specify its mimetype?
@shcheklein I still get the same warning. Also, without a mimetype, the downloaded document is not recognizable as a docx file.
I can explain why this is happening. Check the code here: https://github.com/iterative/PyDrive2/blob/main/pydrive2/files.py#L336-L363
PyDrive2 is doing a try/except. It first tries to download the file, but if the file is a Google online-only format, the Drive API throws a "403 FileNotDownloadable". When that happens, PyDrive2 resorts to the "export file" method, and converts the drive file format as required, e.g. Google spreadsheets are downloaded as Excel files.
So either requests
or googleapiclient
code is logging the warning, not PyDrive2. Stay tuned; I am just in the process of figuring out how to mute these specific errors.
I'm using PyDrive2 v.1.10.0 on Mac to download google doc as docx but I keep getting the following warning even though the file gets downloaded anyway:
Any idea how to silence that or prevent it from happening? Can someone explain why I am getting this warning?
Here is my code:
Note: I get the same warning with
mimetype="application/pdf"
but not withmimetype="application/zip"
Thanks in advance!