Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Fix/issue345 - #347

Merged
jeremylow merged 3 commits into
masterfrom
fix/issue345
Jun 2, 2016
Merged

Fix/issue345#347
jeremylow merged 3 commits into
masterfrom
fix/issue345

Conversation

@jeremylow

@jeremylow jeremylow commented Jun 1, 2016

Copy link
Copy Markdown
Collaborator

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

@jeremylow

Copy link
Copy Markdown
Collaborator Author

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

@bear

bear commented Jun 2, 2016

Copy link
Copy Markdown
Owner

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
@bear
bear deleted the fix/issue345 branch June 2, 2016 03:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants