Accept an errors parameter for text decoding ClientResponses#1542
Merged
fafhrd91 merged 5 commits intoaio-libs:masterfrom Jan 21, 2017
Merged
Accept an errors parameter for text decoding ClientResponses#1542fafhrd91 merged 5 commits intoaio-libs:masterfrom
fafhrd91 merged 5 commits intoaio-libs:masterfrom
Conversation
Current coverage is 98.91% (diff: 100%)@@ master #1542 diff @@
==========================================
Files 30 30
Lines 6995 6989 -6
Methods 0 0
Messages 0 0
Branches 1169 1162 -7
==========================================
- Hits 6920 6913 -7
Misses 37 37
- Partials 38 39 +1
|
Member
|
Could you add test for this change? |
Contributor
Author
|
@fafhrd91 sure - what would you like to be tested though? This is a pretty inconsequential change that just passes another optional parameter down to Python std lib call. |
Member
|
test that |
1a4ae3c to
9c7f964
Compare
Contributor
Author
|
OK - let me know if there's anything else you need @fafhrd91 |
Member
|
great! thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What do these changes do?
Users can now give a parameter specifying what should happen to decoding errors when asking for the
text()from aClientResponse. This is passed directly into the bytes() decode method.The internet is full of websites that have incorrectly specified their character encoding or that have one or two characters on a page that are not encoded correctly. Right now, the
aiohttplibrary just throws an exception when this happens - for a more resilient solution, users should be able to optionally provide an alternative error handling strategy for incorrectly encoded characters.Are there changes in behavior for the user?
Nope - just a new optional parameter.
Related issue number
Nope.
Checklist
CONTRIBUTORS.txtCHANGES.rst#issue_numberformat at the end of changelog message. Use Pull Request number if there are no issues for PR or PR covers the issue only partially.