Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow empty files to be uploaded. #25

Merged
merged 2 commits into from
Aug 7, 2017
Merged

Allow empty files to be uploaded. #25

merged 2 commits into from
Aug 7, 2017

Conversation

lukesneeringer
Copy link
Contributor

@dhermes I am not sure this is actually the correct fix for googleapis/google-cloud-python#3685, but it seems logical and in line with what the original reporter expected.

If this is the wrong answer, I would appreciate guidance on what the correct answer is.

Fixes googleapis/google-cloud-python#3685

@@ -817,7 +817,7 @@ def get_next_chunk(stream, chunk_size, total_bytes):
raise ValueError(msg)

content_range = get_content_range(start_byte, end_byte, total_bytes)
return start_byte, end_byte, payload, content_range
return start_byte, max([end_byte, 0]), payload, content_range

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

In the process, also dropping `end_byte` as part of the
returned values in `get_next_chunk()`. This is because the
function only has one caller and that caller does not use
the `end_byte`.
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

# stream to be at the beginning.
if num_bytes_read != 0:
raise ValueError(
u'Stream specified as empty, but produced non-empty content.')

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Aug 7, 2017

Merging based on a Hangouts LGTM from @lukesneeringer

@dhermes dhermes merged commit 0109aaa into master Aug 7, 2017
@dhermes dhermes deleted the allow-empty-files branch August 7, 2017 17:13
@dhermes dhermes mentioned this pull request Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to upload empty file?
3 participants