Commits

Sviatoslav Sydorenko committed 5ecf94c

JSON fix: strings were converted into arrays of chars, because of __iter__ in py3k for str

Comments (0)

Files changed (1)

src/blueberrypy/util.py

             result = {}
             for k, v in from_.items():
                 result[unicode(k)] = to_collection(v, includes=includes, excludes=excludes, recursive=recursive)
-        elif hasattr(from_, "__iter__"): # iterable collections, not strings
+        # py3k webknjaz fix
+        elif hasattr(from_, "__iter__")  and not isinstance(from_, str): # iterable collections, not strings
             result = [to_collection(v, includes=includes, excludes=excludes, recursive=recursive)
                       for v in from_] if recursive else list(from_)
         else: