Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json.loads Error - related to Python 3? #39

Closed
JanKoppe opened this issue Nov 17, 2016 · 0 comments · Fixed by #44
Closed

json.loads Error - related to Python 3? #39

JanKoppe opened this issue Nov 17, 2016 · 0 comments · Fixed by #44
Labels

Comments

@JanKoppe
Copy link
Contributor

After finishing the recording command, the safe_start_capture() method fails with the following error:

2016-11-17 22:20:01 ERROR    [ca.py:395:safe_start_capture()] Start capture failed
2016-11-17 22:20:01 ERROR    [ca.py:396:safe_start_capture()] Traceback (most recent call last):
  File "/home/jan/git/electures/pyca/pyca/ca.py", line 393, in safe_start_capture
    return start_capture(event)
  File "/home/jan/git/electures/pyca/pyca/ca.py", line 256, in start_capture
    attachments = event.get_data().get('attach')
  File "/home/jan/git/electures/pyca/pyca/db.py", line 69, in get_data
    return json.loads(self.data)
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

This was run on Arch Linux using Python 3.5.2. When run on the same system but with Python 2.7.12, it works just fine.

@JanKoppe JanKoppe added the bug label Nov 17, 2016
lkiesow added a commit that referenced this issue Nov 21, 2016
This patches the Unicode handling of the JSON encoding and decoding
methods of the database module. As well as adding some unit tests to
ensure it is working properly.

This fixes #39

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
lkiesow added a commit that referenced this issue Nov 21, 2016
This patches the Unicode handling of the JSON encoding and decoding
methods of the database module. As well as adding some unit tests to
ensure it is working properly.

This fixes #39

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant