GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: fall back to 'charset' of 'content_type' in 'download_as_text' by tseaver · Pull Request #326 · googleapis/python-storage

This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Conversation

@tseaver

@tseaver tseaver commented Nov 24, 2020

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tseaver
tseaver requested review from andrewsg, crwilcox, frankyn and tswast November 24, 2020 21:29
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 24, 2020
@product-auto-label product-auto-label Bot added the api: storage Issues related to the googleapis/python-storage API. label Nov 24, 2020
@tseaver

tseaver commented Nov 24, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tseaver added 3 commits November 24, 2020 17:41
@tseaver
fix: fall back to 'charset' of 'content_type' in 'download_as_text'
d4ee030
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
chore: rewrap long param descriptions
0f434fb
Improve in-source readability.
@tseaver
tests: coverage
3801122
@tseaver
tseaver force-pushed the 319-blob-download_as_text-cannot-use-content_encoding branch from 30d2dc1 to 3801122 Compare November 24, 2020 22:41
tswast
tswast approved these changes Nov 30, 2020
View reviewed changes

@tswast tswast left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tseaver
tseaver merged commit 63ff233 into master Nov 30, 2020
@tseaver
tseaver deleted the 319-blob-download_as_text-cannot-use-content_encoding branch November 30, 2020 18:07
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
@tseaver @cojenco
fix: fall back to 'charset' of 'content_type' in 'download_as_text' (g…
1602ad8
…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 pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
@tseaver @cojenco
fix: fall back to 'charset' of 'content_type' in 'download_as_text' (g…
4279109
…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.
@release-please release-please Bot mentioned this pull request Jan 12, 2022
chore(main): release 3.0.0 #688
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@crwilcox crwilcox Awaiting requested review from crwilcox
@andrewsg andrewsg Awaiting requested review from andrewsg
@frankyn frankyn Awaiting requested review from frankyn
1 more reviewer
@tswast tswast tswast approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: storage Issues related to the googleapis/python-storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Blob.download_as_text does not decode properly

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tseaver @tswast
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.