[projects/pld-builder.new] log: write the logs in utf-8

arekm arekm at pld-linux.org
Thu Nov 12 10:29:27 CET 2026


commit c402b77bfe035bd2ebc8a9036f290c9ef55a2a11
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Nov 12 10:28:16 2026 +0100

    log: write the logs in utf-8
    
    The builder log and the log of a build quote the request, such as the
    command run. Under the latin-1 locale of the scripts in bin/ a command
    with Polish letters killed the builder that logged it.

 PLD_Builder/log.py  | 2 +-
 PLD_Builder/util.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/PLD_Builder/log.py b/PLD_Builder/log.py
index f52a756..e5e955d 100644
--- a/PLD_Builder/log.py
+++ b/PLD_Builder/log.py
@@ -23,7 +23,7 @@ def log(p, s):
             syslog.syslog(p, str(s))
         except TypeError:
             syslog.syslog(p, repr(s))
-    with open(path.log_file, "a") as f:
+    with open(path.log_file, "a", encoding="utf-8") as f:
         f.write(f"{time.asctime()} [{builder}]: {s} [{os.path.basename(sys.argv[0])}]\n")
 
 class Panic(Exception):
diff --git a/PLD_Builder/util.py b/PLD_Builder/util.py
index 3ce9adb..c8f0247 100644
--- a/PLD_Builder/util.py
+++ b/PLD_Builder/util.py
@@ -14,7 +14,7 @@ def msg(m):
     sys.stderr.write(m)
 
 def append_to(logfile, msg):
-    with open(logfile, "a") as f:
+    with open(logfile, "a", encoding="utf-8") as f:
         f.write(f"{msg}\n")
 
 def write_atomic(name, text):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/389ce5a31104551f35ba9b41daa82bb3d44c89ff



More information about the pld-cvs-commit mailing list