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

fix: fall back to 'charset' of 'content_type' in 'download_as_text' #326

Merged
merged 3 commits into from Nov 30, 2020

Conversation

@tseaver
Copy link
Contributor

@tseaver tseaver commented Nov 24, 2020

Explicit 'encoding' overrides the fallback.

Use the 'charset' param of 'content_type', rather than 'content_encoding',
which isn't going to be a Unicode -> bytes encoding.

Closes #319.

@tseaver
Copy link
Contributor Author

@tseaver tseaver commented Nov 24, 2020

Note for reviewers: the first commit (d4ee030) is the meat of the PR. The second one (0f434fb) is just rewrapping long / overindented docstring params for readability within the source.

tseaver added 3 commits Nov 24, 2020
Explicit 'encoding' overrides the fallback.

Use the 'charset' param of 'content_type', rather than 'content_encoding',
which isn't going to be a Unicode -> bytes encoding.

Closes #319.
Improve in-source readability.
@tseaver tseaver force-pushed the 319-blob-download_as_text-cannot-use-content_encoding branch from 30d2dc1 to 3801122 Nov 24, 2020
tswast
tswast approved these changes Nov 30, 2020
Copy link
Contributor

@tswast tswast left a comment

LGTM for Python readability. Thanks for adding clear tests for this case (no explicit encode, but with a charset in the content-type header)

@tseaver tseaver merged commit 63ff233 into master Nov 30, 2020
5 checks passed
@tseaver tseaver deleted the 319-blob-download_as_text-cannot-use-content_encoding branch Nov 30, 2020
shaffeeullah added a commit to shaffeeullah/python-storage that referenced this issue Jan 26, 2021
…oogleapis#326)

Explicit 'encoding' overrides the fallback.

Use the 'charset' param of 'content_type', rather than 'content_encoding',
which isn't going to be a Unicode -> bytes encoding.

Closes googleapis#319.

Also, rewrap long param descriptions for in-source readability.
shaffeeullah added a commit to shaffeeullah/python-storage that referenced this issue Jan 26, 2021
…oogleapis#326)

Explicit 'encoding' overrides the fallback.

Use the 'charset' param of 'content_type', rather than 'content_encoding',
which isn't going to be a Unicode -> bytes encoding.

Closes googleapis#319.

Also, rewrap long param descriptions for in-source readability.
cojenco added a commit to cojenco/python-storage that referenced this issue Oct 13, 2021
…oogleapis#326)

Explicit 'encoding' overrides the fallback.

Use the 'charset' param of 'content_type', rather than 'content_encoding',
which isn't going to be a Unicode -> bytes encoding.

Closes googleapis#319.

Also, rewrap long param descriptions for in-source readability.
cojenco added a commit to cojenco/python-storage that referenced this issue Oct 13, 2021
…oogleapis#326)

Explicit 'encoding' overrides the fallback.

Use the 'charset' param of 'content_type', rather than 'content_encoding',
which isn't going to be a Unicode -> bytes encoding.

Closes googleapis#319.

Also, rewrap long param descriptions for in-source readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants