Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- meh/dump.py | 2 ++ meh/handler.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/meh/dump.py b/meh/dump.py index 2e8c94a..e9779f0 100644 --- a/meh/dump.py +++ b/meh/dump.py @@ -344,6 +344,8 @@ class ExceptionDump(object): ret += self._dumpClass(v, level + 1, parentkey = curkey, skipList=skipList) ret += "}\n" elif __isSimpleType(value): + if type(value) == types.UnicodeType: + value = value.encode("utf-8") ret += "%s%s: %s\n" % (pad, curkey, value) else: ret += "%s%s: " % (pad, curkey) diff --git a/meh/handler.py b/meh/handler.py index 7958b86..576af6b 100644 --- a/meh/handler.py +++ b/meh/handler.py @@ -96,10 +96,10 @@ class ExceptionHandler(object):
# Save the exception to the filesystem first. self.exn = self.exnClass((ty, value, tb), self.conf) - (fd, self.exnFile) = self.openFile() + (fobj, self.exnFile) = self.openFile() self.exnText = self.exn.traceback_and_object_dump(obj) - fd.write(self.exnText.encode("utf-8")) - fd.close() + fobj.write(self.exnText) + fobj.close()
self.postWriteHook((ty, value, tb), obj)
Ack.
----- Original Message -----
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
meh/dump.py | 2 ++ meh/handler.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/meh/dump.py b/meh/dump.py index 2e8c94a..e9779f0 100644 --- a/meh/dump.py +++ b/meh/dump.py @@ -344,6 +344,8 @@ class ExceptionDump(object): ret += self._dumpClass(v, level + 1, parentkey = curkey, skipList=skipList) ret += "}\n" elif __isSimpleType(value):
if type(value) == types.UnicodeType:
value = value.encode("utf-8") ret += "%s%s: %s\n" % (pad, curkey, value) else: ret += "%s%s: " % (pad, curkey)
diff --git a/meh/handler.py b/meh/handler.py index 7958b86..576af6b 100644 --- a/meh/handler.py +++ b/meh/handler.py @@ -96,10 +96,10 @@ class ExceptionHandler(object):
# Save the exception to the filesystem first. self.exn = self.exnClass((ty, value, tb), self.conf)
(fd, self.exnFile) = self.openFile()
(fobj, self.exnFile) = self.openFile() self.exnText = self.exn.traceback_and_object_dump(obj)
fd.write(self.exnText.encode("utf-8"))
fd.close()
fobj.write(self.exnText)
fobj.close() self.postWriteHook((ty, value, tb), obj)
-- 1.7.11.4
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
anaconda-patches@lists.fedorahosted.org