Skip to content

Commit 11182a9

Browse files
committed
Must decode json in python 3 . Assume default utf8 encoding.
1 parent 5767c53 commit 11182a9

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy