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

Conversation

@PhilippWendler
Copy link

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'

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'
}}}
machadoit added a commit that referenced this pull request Nov 25, 2015
Fix crash on final message with Python 3
@machadoit machadoit merged commit af8f157 into archived-codacy:master Nov 25, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants