summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Nitzo <nitzo2001@yahoo.com> 2016-04-17 21:52:16 +0200
committerGravatar Nitzo <nitzo2001@yahoo.com> 2016-04-17 21:52:16 +0200
commit88c85ebb526b7fe9fd77b2d5621e4e77bd13d5b9 (patch)
treee5fb375166643d579b748159bb6e08f9ebacf827 /module
parentMerge pull request #2422 from bogeyman/stable (diff)
downloadpyload-88c85ebb526b7fe9fd77b2d5621e4e77bd13d5b9.tar.xz
[misc] Fix DB.store() bug that causes a dictionary to be converted to an array
Diffstat (limited to 'module')
-rw-r--r--module/plugins/internal/misc.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/module/plugins/internal/misc.py b/module/plugins/internal/misc.py
index b8a9cf143..606c0c528 100644
--- a/module/plugins/internal/misc.py
+++ b/module/plugins/internal/misc.py
@@ -38,7 +38,7 @@ except ImportError:
class misc(object):
__name__ = "misc"
__type__ = "plugin"
- __version__ = "0.33"
+ __version__ = "0.34"
__status__ = "stable"
__pattern__ = r'^unmatchable$'
@@ -91,8 +91,7 @@ class DB(object):
"""
Saves a value persistently to the database
"""
- value = map(decode, value) if isiterable(value) else decode(value)
- entry = json.dumps(value).encode('base64')
+ entry = json.dumps(value, ensure_ascii=False).encode('base64')
self.plugin.pyload.db.setStorage(self.plugin.classname, key, entry)
@@ -335,9 +334,9 @@ def uniqify(seq):
def has_method(obj, name):
"""
- Check if name was defined in obj (return false if inhereted)
+ Check if function 'name' was defined in obj
"""
- return hasattr(obj, '__dict__') and name in obj.__dict__
+ return callable(getattr(obj, name, None))
def html_unescape(text):