Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit 50bc03a

Browse files
Fix crash on final message with Python 3
With Python 3, the tool crashes after uploading the coverage results with the following message: {{{ 2015-11-22 16:25:40,601 - INFO - Parsing report file... 2015-11-22 16:25:40,909 - INFO - Uploading report... 2015-11-22 16:25:40,928 - INFO - Starting new HTTPS connection (1): api.codacy.com Traceback (most recent call last): File "/home/wendler/venv/benchexec-src/bin/python-codacy-coverage", line 9, in <module> load_entry_point('codacy-coverage==1.1.0', 'console_scripts', 'python-codacy-coverage')() File "/home/wendler/venv/benchexec-src/src/codacy/src/codacy/__init__.py", line 6, in main return reporter.run() File "/home/wendler/venv/benchexec-src/src/codacy/src/codacy/reporter.py", line 140, in run upload_report(report, CODACY_PROJECT_TOKEN, args.commit) File "/home/wendler/venv/benchexec-src/src/codacy/src/codacy/reporter.py", line 110, in upload_report message = json.loads(r.content)['success'] File "/usr/lib/python3.4/json/__init__.py", line 312, in loads s.__class__.__name__)) TypeError: the JSON object must be str, not 'bytes' }}}
1 parent e3a6f06 commit 50bc03a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/codacy/reporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def upload_report(report, token, commit):
107107
logging.debug(r.content)
108108
r.raise_for_status()
109109

110-
message = json.loads(r.content)['success']
110+
message = json.loads(r.text)['success']
111111
logging.info(message)
112112

113113

0 commit comments

Comments
 (0)