mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 02:33:18 +00:00
Fix for Python 3
Default for Python 3 is to return byte-objects, not string. This will cause the plugin to fail with an error: "TypeError: a bytes-like object is required, not 'str'". Fixed by decoding for UTF8.
This commit is contained in:
parent
26bcef2f21
commit
d628ff5a50
1 changed files with 1 additions and 1 deletions
|
@ -122,7 +122,7 @@ else:
|
|||
auth = urllib.request.HTTPBasicAuthHandler(mgr)
|
||||
opener = urllib.request.build_opener(auth)
|
||||
urllib.request.install_opener(opener)
|
||||
info = urllib.request.urlopen(request).read()
|
||||
info = urllib.request.urlopen(request).read().decode('utf-8')
|
||||
data = {}
|
||||
for line in info.split("\n"):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue