Skip to content

HttpError 416 On 0 byte files #241

Closed
@znorris

Description

@znorris

When attempting to download the first chunk of a 0 byte file googleapiclient.http.MediaIoBaseDownload() throws a googleapiclient.errors.HttpError. Modifying the default chunksize does 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 200 and 206 response codes before writing the content to file, should we add a condition for 416?

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.priority: p2Moderately-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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions