-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
MediaIoBaseDownload next_chunk() Range header off-by-one #1593
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Comments
Hi @jvtm , I'm looking into it. In the meantime, please feel free to open a PR. |
jvtm
added a commit
to jvtm/google-api-python-client
that referenced
this issue
Nov 8, 2021
Issue: It looks like Range header end value was constructed by adding chunk size to current position. This leads into the request being one byte longer, and also the received response body is one byte longer than anticipated. Fix: adjust the end to be one byte earlier. For example with `chunksize=1024` and current position being 0, the range header should be set to `bytes=0-1023`. See: https://httpwg.org/specs/rfc7233.html#rule.ranges-specifier Resolves: googleapis#1593
jvtm
added a commit
to jvtm/google-api-python-client
that referenced
this issue
Nov 8, 2021
Issue: It looks like Range header end value was constructed by adding chunk size to current position. This leads into the request being one byte longer, and also the received response body is one byte longer than anticipated. Fix: adjust the end to be one byte earlier. For example with `chunksize=1024` and current position being 0, the range header should be set to `bytes=0-1023`. See: https://httpwg.org/specs/rfc7233.html#rule.ranges-specifier Resolves: googleapis#1593
4 tasks
PR opened, CLA signed |
jvtm
added a commit
to jvtm/google-api-python-client
that referenced
this issue
Nov 9, 2021
Issue: It looks like Range header end value was constructed by adding chunk size to current position. This leads into the request being one byte longer, and also the received response body is one byte longer than anticipated. Fix: adjust the end to be one byte earlier. For example with `chunksize=1024` and current position being 0, the range header should be set to `bytes=0-1023`. See: https://httpwg.org/specs/rfc7233.html#rule.ranges-specifier Resolves: googleapis#1593
gcf-merge-on-green bot
pushed a commit
that referenced
this issue
Nov 11, 2021
Issue: It looks like Range header end value was constructed by adding chunk size to current position. This leads into the request being one byte longer, and also the received response body is one byte longer than anticipated. Fix: adjust the end to be one byte earlier. For example with `chunksize=1024` and current position being 0, the range header should be set to `bytes=0-1023`. See: https://httpwg.org/specs/rfc7233.html#rule.ranges-specifier Fixes #1593 ---- Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/google-api-python-client/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #1593 🦕
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
python --version
pip --version
google-api-python-client
version:pip show google-api-python-client
Steps to reproduce
MediaIoBaseDownload(..., chunksize=1024)
for downloading a file from Google Drive (see https://developers.google.com/drive/api/v3/manage-downloads#python)Code example
In real life chunk size should be few megabytes at least. Default seems to be 100MiB:
Stack trace
.
Patch
Is it worth making a PR, signing CLA? :D
The text was updated successfully, but these errors were encountered: