diff options
author | Nitzo <nitzo2001@yahoo.com> | 2016-04-17 21:52:16 +0200 |
---|---|---|
committer | Nitzo <nitzo2001@yahoo.com> | 2016-04-17 21:52:16 +0200 |
commit | 88c85ebb526b7fe9fd77b2d5621e4e77bd13d5b9 (patch) | |
tree | e5fb375166643d579b748159bb6e08f9ebacf827 | |
parent | Merge pull request #2422 from bogeyman/stable (diff) | |
download | pyload-88c85ebb526b7fe9fd77b2d5621e4e77bd13d5b9.tar.xz |
[misc] Fix DB.store() bug that causes a dictionary to be converted to an array
-rw-r--r-- | module/plugins/internal/misc.py | 9 |
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): |