Opened 6 years ago
Closed 6 years ago
#30550 closed Bug (fixed)
TestClient's response.json() should decode content using the response charset.
| Reported by: | Jon Dufresne | Owned by: | Jon Dufresne |
|---|---|---|---|
| Component: | Testing framework | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Right now, response.json() always decodes using utf-8.
response._json = json.loads(response.content.decode(), **extra)
While this is frequently correct, the response may be any encoding. If it is a non-UTF-8 encoding, the content should be decoded as such.
Change History (3)
comment:1 by , 6 years ago
| Has patch: | set |
|---|
comment:2 by , 6 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
| Summary: | TestClient's response.json() should decode content using the response charset → TestClient's response.json() should decode content using the response charset. |
| Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
PR