Skip to content

Commit d196ae6

Browse files
committed
Fix json decoding on Python 3
1 parent 376fb43 commit d196ae6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

influxdb/client.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,7 @@ def query(self, query, time_precision='s', chunked=False):
322322
status_code=200
323323
)
324324

325-
try:
326-
res = json.loads(response.content)
327-
except TypeError:
328-
# must decode in python 3
329-
res = json.loads(response.content.decode('utf8'))
330-
331-
return res
325+
return response.json()
332326

333327
# Creating and Dropping Databases
334328
#
@@ -396,7 +390,7 @@ def get_database_list(self):
396390
status_code=200
397391
)
398392

399-
return json.loads(response.content)
393+
return response.json()
400394

401395
def delete_series(self, series):
402396
"""

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