rubenvereecken / pokemongo-api

Pokemon Go API for Python
Other
358 stars 120 forks source link

Fix "TypeError: the JSON object must be str, not 'bytes'" for ptc #7

Closed DracoBlue closed 8 years ago

DracoBlue commented 8 years ago

Because of:

Traceback (most recent call last):
  File "demo.py", line 38, in <module>
    session = api.createPTCSession(args.username, args.password, args.location)
  File "/Volumes/development/workspaces/pokemongo-api/pogo/api.py", line 67, in createPTCSession
    jdata = json.loads(r.content)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

if you try to login with a "ptc" account on python 3.4.