Skip to content

Bugfix: use apparent_encoding if encoding is set to None - #91

Closed
maiiku wants to merge 2 commits into
intercom:masterfrom
maiiku:bugfix_use_apparent_encoding_when_none_provided
Closed

maiiku wants to merge 2 commits into
intercom:masterfrom
maiiku:bugfix_use_apparent_encoding_when_none_provided

Conversation

@maiiku

@maiiku maiiku commented May 8, 2015

Copy link
Copy Markdown

Defeat value for encoding attribute in class requests.Response is None. If server doesn't set it to something useful (ie on 202 responses) it remains None and gets passed to decode() and thus fails. Class requests. Response has very nice fallback, apparent_encoding, that is provided by the chardet library and can come in handy here.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 92.06% when pulling 8099166 on maiiku:bugfix_use_apparent_encoding_when_none_provided into 949056d on jkeyes:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 92.06% when pulling 8099166 on maiiku:bugfix_use_apparent_encoding_when_none_provided into 949056d on jkeyes:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.03%) to 92.03% when pulling 110eb49 on maiiku:bugfix_use_apparent_encoding_when_none_provided into 949056d on jkeyes:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 92.06% when pulling 1b0f1d6 on maiiku:bugfix_use_apparent_encoding_when_none_provided into 949056d on jkeyes:master.

@maiiku
maiiku force-pushed the bugfix_use_apparent_encoding_when_none_provided branch from 1b0f1d6 to 964444b Compare May 8, 2015 11:04
@maiiku

maiiku commented May 8, 2015

Copy link
Copy Markdown
Author

I pulled in #88 into this PR as well
Also #90 does similar changes

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 92.06% when pulling 964444b on maiiku:bugfix_use_apparent_encoding_when_none_provided into 949056d on jkeyes:master.

@jkeyes

jkeyes commented May 9, 2015

Copy link
Copy Markdown
Contributor

Thanks @maiiku, I'll take a look at this today.

@jkeyes

jkeyes commented May 12, 2015

Copy link
Copy Markdown
Contributor

Fixed and now in version 2.0, available from PyPi. See 8ca7d74 and f911a5f for the changes and tests.

Thanks again, I've added your profile to the AUTHORS page.

@jkeyes jkeyes closed this May 12, 2015
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.

3 participants