From da063ffbee6d7b636dfa7df8df07ad88e28b3c94 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Wed, 11 May 2011 20:16:57 +0100 Subject: [PATCH] Updated bug reporter to cope with utf-8 in the log file --- bugs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bugs.py b/bugs.py index 00fc617..7421f9a 100644 --- a/bugs.py +++ b/bugs.py @@ -1,7 +1,7 @@ # Copyright (C) 2006, Thomas Leonard # See http://0install.net/0compile.html -import os, __main__ +import os, __main__, codecs from os.path import join from support import BuildEnv @@ -11,7 +11,7 @@ def do_report_bug(args): buildenv = BuildEnv() log_name = 'build/build-failure.log' - build_log = file(log_name) + build_log = codecs.open(log_name, 'r', 'utf-8') log_text = build_log.read() build_log.close() @@ -23,6 +23,8 @@ def do_report_bug(args): else: log_text += '\n\n"%s" file not found' % build_env_xml_file + log_text = codecs.encode(log_text, 'utf-8') + import urllib from urllib2 import urlopen -- 2.11.4.GIT