From 800d8fbbef7e59bb875f3a05d1ddc7969259871f Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 13 May 2013 09:56:16 +0300 Subject: Return strings as unicode --- gsxws/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gsxws/core.py b/gsxws/core.py index 2b4b7be..a33f755 100644 --- a/gsxws/core.py +++ b/gsxws/core.py @@ -327,10 +327,8 @@ class GsxObject(object): k, v = r.tag, r.text if hasattr(obj, k): - # found duplicate tag %s" % k attr = obj.__getattr__(k) - if isinstance(attr, list): # append to existing list newattr = attr.append(newitem) @@ -353,6 +351,9 @@ class GsxObject(object): v = base64.b64decode(v) if isinstance(v, basestring): + + v = unicode(v) # "must be unicode, not str" + # convert dates to native Python type if re.search('^\d{2}/\d{2}/\d{2}$', v): m, d, y = v.split('/') -- cgit v1.2.3