PyDrive
PyDrive copied to clipboard
Empty files not handled well
If SetContentFile is used with an empty file, the result is a bad http request on Windows.
code:
f = drive.CreateFile({'title': 'test.html'})
empty_file = # path to 0 byte file
f.SetContentFile(empty_file)
f.Upload()
Hey @matteyas, thank you for listing the issue here. It was a problem with the resumable setting when uploading files - apparently the API can't handle empty files when uploading with resumable = True.
Version 1.3.2 on the dev branch now has the fix. I will close this issue once the new version is deployed.
Seems to be fixed in https://github.com/googleapis/google-api-python-client/issues/638 (google-api-python-client >= 1.12.25) https://github.com/googleworkspace/PyDrive/blob/871f7d644dd5df1c6190f7c7eebbab9721ccd4f4/setup.py#L16