mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 02:33:18 +00:00
Fix urllib request decoding
This commit is contained in:
parent
16d38264aa
commit
87280ed7c3
1 changed files with 2 additions and 2 deletions
|
@ -37,7 +37,7 @@ Copyright (C) 2019 pcy <pcy.ulyssis.org>
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import urllib
|
import urllib.request
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ logarithmic = weakbool(os.getenv('logarithmic', 'N'))
|
||||||
def reqjson():
|
def reqjson():
|
||||||
try:
|
try:
|
||||||
raw_data = urllib.request.urlopen(url)
|
raw_data = urllib.request.urlopen(url)
|
||||||
return json.loads(raw_data)
|
return json.loads(raw_data.read().decode())
|
||||||
except IOError:
|
except IOError:
|
||||||
print("Cannot reach the GitLab API endpoint.", file=sys.stderr)
|
print("Cannot reach the GitLab API endpoint.", file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue