From: Ed Page Date: Mon, 8 Nov 2010 23:52:17 +0000 (-0600) Subject: Fixing non-ascii support X-Git-Url: http://git.maemo.org/git/?p=theonering;a=commitdiff_plain;h=da66a4ebd1deb3939a5bcf4abcd0d6d9708b59d8;ds=sidebyside Fixing non-ascii support --- diff --git a/src/channel/text.py b/src/channel/text.py index f4a9589..206299c 100644 --- a/src/channel/text.py +++ b/src/channel/text.py @@ -72,7 +72,7 @@ class TextChannel(tp.ChannelTypeText): {}, ) except Exception: - _moduleLogger.exception(result) + _moduleLogger.exception("Oh no, what happened?") return self._conn.session.textsStateMachine.reset_timers() diff --git a/src/gvoice/backend.py b/src/gvoice/backend.py index 47b5fc3..d910f4b 100755 --- a/src/gvoice/backend.py +++ b/src/gvoice/backend.py @@ -87,7 +87,7 @@ class Message(object): return "%s (%s): %s" % ( self.whoFrom, self.when, - "".join(str(part) for part in self.body) + "".join(unicode(part) for part in self.body) ) def to_dict(self): @@ -393,7 +393,7 @@ class GVoiceBackend(object): self._sendSmsURL, { 'phoneNumber': flattenedPhoneNumbers, - 'text': message + 'text': unicode(message).encode("utf-8"), }, ) self._parse_with_validation(page) diff --git a/src/util/go_utils.py b/src/util/go_utils.py index 46805ab..10b14e8 100644 --- a/src/util/go_utils.py +++ b/src/util/go_utils.py @@ -183,7 +183,7 @@ class AsyncPool(object): result = func(*args, **kwds) isError = False except Exception, e: - _moduleLogger.error("Error, passing it back to the main thread") + _moduleLogger.exception("Error, passing it back to the main thread") result = e isError = True self.__workQueue.task_done()