-
Notifications
You must be signed in to change notification settings - Fork 2.6k
HttpError 416 On 0 byte files #241
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
When attempting to download the first chunk of a 0 byte file
googleapiclient.http.MediaIoBaseDownload()throws agoogleapiclient.errors.HttpError. Modifying the defaultchunksizedoes not help.However, if you remove the header entirely (downloading without chunking) a 0 byte file can be downloaded without receiving a HTTP 416 error.
I'm not sure what anyone thinks of this solutions but currently we're checking for HTTP
200and206response codes before writing the content to file, should we add a condition for416?