changeset 1955:385ef66339aa namespaces

deserializer: deal with single names, convert them to list of names
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 09 Feb 2013 04:42:17 +0100
parents 46f2e436b5ee
children 8c0b20b0b78d
files MoinMoin/storage/middleware/serialization.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/storage/middleware/serialization.py	Sat Feb 09 04:14:42 2013 +0100
+++ b/MoinMoin/storage/middleware/serialization.py	Sat Feb 09 04:42:17 2013 +0100
@@ -66,6 +66,10 @@
         meta_str = src.read(meta_size)
         text = meta_str.decode('utf-8')
         meta = json.loads(text)
+        name = meta.get('name')
+        if isinstance(name, unicode):
+            # if we encounter single names, make a list of names:
+            meta['name'] = [name, ]
         data_size = meta[u'size']
         curr_pos = src.tell()
         limited = LimitedStream(src, data_size)