diff --git a/data/tools/unit_tree/html_output.py b/data/tools/unit_tree/html_output.py
index f115bba0a14..cb8b38e6908 100644
--- a/data/tools/unit_tree/html_output.py
+++ b/data/tools/unit_tree/html_output.py
@@ -1108,7 +1108,7 @@ def generate_single_unit_reports(addon, isocode, wesnoth):
for uid, unit in wesnoth.unit_lookup.items():
if unit.hidden: continue
if "mainline" in unit.campaigns and addon != "mainline": continue
- filename = os.path.join(path, "%s.html" % uid)
+ filename = os.path.join(path, "%s.html" % (uid.encode("utf8")))
# We probably can come up with something better.
if os.path.exists(filename):
@@ -1123,7 +1123,7 @@ def generate_single_unit_reports(addon, isocode, wesnoth):
def html_postprocess_file(filename, isocode, batchlist):
- print("postprocessing " + filename.encode("utf8"))
+ print(u"postprocessing " + repr(filename))
chtml = u""
ehtml = u""
diff --git a/data/tools/wmlunits b/data/tools/wmlunits
index af39bed0289..791cce1a435 100755
--- a/data/tools/wmlunits
+++ b/data/tools/wmlunits
@@ -476,7 +476,7 @@ def batch_process():
print(" " + name + " failed")
ef = open(logname, "a")
ef.write("\n")
- ef.write("please report as bug")
+ ef.write("please report as bug\n")
ef.write(str(e))
ef.write("\n")
ef.close()