varlink / python

Python implementation of the Varlink protocol
https://varlink.org/python/
Apache License 2.0
43 stars 8 forks source link

Python3.4 json.loads() only accepts str's #7

Closed jwhonce closed 6 years ago

jwhonce commented 6 years ago

$ grep -2 loads varlink/client.py message = next(self._next_message())

    message = json.loads(message)
    if not 'parameters' in message:
        message['parameters'] = {}

When using python 3.4, message is a byte array while json.loads() only accepts str's. Changing the line to message = json.loads(message.decode('utf-8')) works, but I'm not sure that is the best solution.