diff options
| author | 2018-10-10 15:25:08 +0100 | |
|---|---|---|
| committer | 2018-10-10 15:25:08 +0100 | |
| commit | f286f3bf48f906340190c5569b57fb7e4494897b (patch) | |
| tree | 054cdb7ae55f9b4a4b507ec97b6c418682193d06 /src/utils/http.py | |
| parent | Fix syntax error for throwing a timeout when signal.alarm fires (diff) | |
| signature | ||
.decode data prior to json.loads in utils.http.get_url
Diffstat (limited to 'src/utils/http.py')
| -rw-r--r-- | src/utils/http.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/utils/http.py b/src/utils/http.py index 9176fe20..d8b96dc7 100644 --- a/src/utils/http.py +++ b/src/utils/http.py @@ -53,14 +53,13 @@ def get_url(url, method="GET", get_params={}, post_data=None, headers={}, return response.code, soup return soup - data = response_content + data = response_content.decode(response.encoding) if json and data: try: data = _json.loads(data) except _json.decoder.JSONDecodeError as e: raise HTTPParsingException(str(e)) - data = data.decode(response.encoding) if code: return response.status_code, data else: |
