From 73c2d42182e5a614deab86583bca4668e59a0948 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 21 Nov 2007 22:01:42 +0000 Subject: [PATCH] replaced str() calls with unicode() git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1141 9efc2488-bf62-4759-914b-345cdb29e865 --- src/python/osrf/gateway.py | 4 ++-- src/python/osrf/utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/osrf/gateway.py b/src/python/osrf/gateway.py index fac0647..424b094 100644 --- a/src/python/osrf/gateway.py +++ b/src/python/osrf/gateway.py @@ -25,7 +25,7 @@ class GatewayRequest: response =urllib2.urlopen(request) except urllib2.HTTPError, e: # log this? - sys.stderr.write('%s => %s?%s\n' % (str(e), self.buildURL(), params)) + sys.stderr.write('%s => %s?%s\n' % (unicode(e), self.buildURL(), params)) raise e return self.handleResponse(response) @@ -95,7 +95,7 @@ class XMLGatewayRequest(GatewayRequest): try: parser.parse(response) except Exception, e: - osrfLogErr('Error parsing gateway XML: %s' % str(e)) + osrfLogErr('Error parsing gateway XML: %s' % unicode(e)) return None return handler.getResult() diff --git a/src/python/osrf/utils.py b/src/python/osrf/utils.py index 6b20675..e07ba7a 100644 --- a/src/python/osrf/utils.py +++ b/src/python/osrf/utils.py @@ -57,7 +57,7 @@ def osrfXMLNodeToObject(xmlNode): # If the node has no element children, clean up the text content # and use that as the data xmlNode = xmlNode.childNodes[0] # extract the text node - data = re.compile('^\s*').sub('', str(xmlNode.nodeValue)) + data = re.compile('^\s*').sub('', unicode(xmlNode.nodeValue)) data = re.compile('\s*$').sub('', data) obj[nodeName] = data -- 2.11.0