Blame SOURCES/090fd29acf4af0d8e13fcf2861b14a356db72641.patch

ebda66
From 090fd29acf4af0d8e13fcf2861b14a356db72641 Mon Sep 17 00:00:00 2001
ebda66
From: Sbgodin <christophe.henry@sbgodin.fr>
ebda66
Date: Sun, 7 Mar 2021 12:51:45 +0000
ebda66
Subject: [PATCH] python: Fix exception with list_pluginpref()
ebda66
ebda66
__decode cannot work (with Python3) because prefs_str has no attribute 'decode'.
ebda66
ebda66
Related to https://github.com/hexchat/hexchat/issues/2531
ebda66
---
ebda66
 plugins/python/_hexchat.py | 2 +-
ebda66
 1 file changed, 1 insertion(+), 1 deletion(-)
ebda66
ebda66
diff --git a/plugins/python/_hexchat.py b/plugins/python/_hexchat.py
ebda66
index 567b34934..5e4b0c65f 100644
ebda66
--- a/plugins/python/_hexchat.py
ebda66
+++ b/plugins/python/_hexchat.py
ebda66
@@ -319,7 +319,7 @@ def del_pluginpref(name):
ebda66
 def list_pluginpref():
ebda66
     prefs_str = ffi.new('char[4096]')
ebda66
     if lib.hexchat_pluginpref_list(lib.ph, prefs_str) == 1:
ebda66
-        return __decode(prefs_str).split(',')
ebda66
+        return __decode(ffi.string(prefs_str)).split(',')
ebda66
 
ebda66
     return []
ebda66