From d628ff5a5069841433ee0a91260a0e1704555231 Mon Sep 17 00:00:00 2001 From: Kai Date: Sat, 25 Feb 2023 21:49:52 +0100 Subject: [PATCH] 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. --- plugins/lighttpd/lighttpd_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/lighttpd/lighttpd_ b/plugins/lighttpd/lighttpd_ index a120401b..1d7ac0eb 100755 --- a/plugins/lighttpd/lighttpd_ +++ b/plugins/lighttpd/lighttpd_ @@ -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: