PyDrive icon indicating copy to clipboard operation
PyDrive copied to clipboard

Empty files not handled well

Open matteyas opened this issue 9 years ago • 2 comments

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()

matteyas avatar Jan 19 '17 02:01 matteyas

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.

RNabel avatar Mar 10 '17 23:03 RNabel

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

efiop avatar Oct 22 '20 15:10 efiop