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

Fix/issue345 #347

merged 3 commits into from Jun 2, 2016


None yet
2 participants

jeremylow commented Jun 1, 2016

Fixes three issues:

  1. python27 doesn't have a bytes() method that's compatible with python3's bytes() method, so I had to change to "a string".encode('utf8') for constructing the body of a chunked upload (i.e., a GIF or MP4).

  2. The UploadMediaChunked() method was pretty much untestable in its previous form and did way too much within a single function, so it is now broken out into three functions:

    a. _UploadMediaChunkedInit() <- starts the upload
    b. _UploadMediaChunkedAppend() <- sends actual data
    c. _UploadMediaChunkedFinalize() <- finishes the upload

    These get called in sequence in UploadMediaChunked() and that method is called and returns as before, but now we can test the individual parts of the upload.

  3. Calling PostUpdate() tried to iterate over an int if you called it with media=fp, so that got fixed too.

This change is Reviewable


This comment has been minimized.


jeremylow commented Jun 1, 2016

There's also an adorable corgi GIF, so I think my work here is done.


This comment has been minimized.


bear commented Jun 2, 2016

Reviewed 5 of 5 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.

Comments from Reviewable

@jeremylow jeremylow merged commit 44dd464 into master Jun 2, 2016

2 checks passed

ci/circleci Your tests passed on CircleCI!
code-review/reviewable 5 files reviewed

@bear bear deleted the fix/issue345 branch Jun 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment