Reputation: 705
During firing off:
GCMDevice.send_message(message)
I get:
File "/home/vagrant/.venvs/any_dev/lib/python3.4/site-packages/push_notifications/gcm.py", line 103, in _gcm_send_json
result = json.loads(_gcm_send(data, "application/json"))
File "/usr/local/lib/python3.4/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
It's said that lib's python 3.x compatible, but I guess there's problem with encoding. Did anybody experienced something like that?
Upvotes: 0
Views: 165
Reputation: 26
in gcm.py(in my case, located at ~/.virtualenvs/grape/lib/python3.4/site-packages/push_notifications/gcm.py)
replace
result = json.loads(_gcm_send(data, "application/json"))
to
result = json.loads(_gcm_send(data, "application/json").decode('utf8'))
Upvotes: 1