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

Issue/386 encoding fixes #443

Merged
merged 5 commits into from
Dec 2, 2020

Conversation

blepabyte
Copy link
Contributor

Proposed Changes

  • Fix return type in docstring of Requester.request
  • Fixes File.download hangs in debug statement indefinately #386 by avoiding call to response.text (response.json() internally calls response.text) - the underlying issue is that the requests library relies on chardet to determine the encoding of data, but it's impractically slow for binary data (which can occur when File.download is called on a non-text file) so effectively hangs
  • Adds an option to return bytes from File.get_contents directly

Fixes #386 .

Note: I added a test test_request_get_binary but couldn't find a way to make it work with theregister_uris function in util by adding a fixture since JSON doesn't seem to support binary data.

@coveralls
Copy link

coveralls commented Nov 18, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 52db66f on blepabyte:issue/386-encoding-fixes into e74ca80 on ucfopen:develop.

@Thetwam Thetwam added this to the CanvasAPI v2.1.0 milestone Nov 30, 2020
@Thetwam
Copy link
Member

Thetwam commented Dec 2, 2020

Great find and solution. Thanks for the help @blepabyte !

Travis is being super slow, but it passed in py 3.6 there and on 3.8 on my local. Am going to override merge.

@Thetwam Thetwam merged commit 315069c into ucfopen:develop Dec 2, 2020
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.

File.download hangs in debug statement indefinately
3 participants