[PATCH 1/2] Encode dump as utf-8 before writing to file (#854688)
Vratislav Podzimek
vpodzime at redhat.com
Thu Sep 6 11:55:58 UTC 2012
Writing to file uses ascii codec by default, which causes tracebacks
when writing non-ascii characters.
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
meh/handler.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meh/handler.py b/meh/handler.py
index 1010106..003bf82 100644
--- a/meh/handler.py
+++ b/meh/handler.py
@@ -98,7 +98,7 @@ class ExceptionHandler(object):
self.exn = self.exnClass((ty, value, tb), self.conf)
(fd, self.exnFile) = self.openFile()
self.exnText = self.exn.traceback_and_object_dump(obj)
- fd.write(self.exnText)
+ fd.write(self.exnText.encode("utf-8"))
fd.close()
self.postWriteHook((ty, value, tb), obj)
--
1.7.11.4
More information about the anaconda-patches
mailing list