Skip to content

Commit e259392

Browse files
committed
Merge pull request influxdata#36 from itd/master
Must decode json in python 3 . Assume default utf8 encoding.
2 parents 5767c53 + 11182a9 commit e259392

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

influxdb/client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,13 @@ def query(self, query, time_precision='s', chunked=False):
255255
status_code=200
256256
)
257257

258-
return json.loads(response.content)
258+
try:
259+
res = json.loads(response.content)
260+
except TypeError:
261+
# must decode in python 3
262+
res = json.loads(response.content.decode('utf8'))
263+
264+
return res
259265

260266
# Creating and Dropping Databases
261267
#

0 commit comments

Comments
 (0)