[projects/pld-builder.new] queue: read and write the queue files in utf-8
arekm
arekm at pld-linux.org
Thu Nov 12 10:29:22 CET 2026
commit 30cb3eb5aa2fa61aa837c03da929404c55abeb7f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Nov 12 10:26:19 2026 +0100
queue: read and write the queue files in utf-8
The scripts in bin/ run with a latin-1 locale, so a request with text
outside it, such as a command with Polish letters, killed whoever wrote
the queue: the request handler, the src builder or the request fetcher.
The queues are now always utf-8, as queue.gz already was.
PLD_Builder/bqueue.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/PLD_Builder/bqueue.py b/PLD_Builder/bqueue.py
index 31d93cb..e535a9f 100644
--- a/PLD_Builder/bqueue.py
+++ b/PLD_Builder/bqueue.py
@@ -22,7 +22,7 @@ class B_Queue:
def dump(self, fname):
(fdno, tmpfname) = tempfile.mkstemp(dir=os.path.dirname(fname))
- f = os.fdopen(fdno, "w")
+ f = os.fdopen(fdno, "w", encoding="utf-8")
self.requests.reverse()
for r in self.requests:
r.dump(f)
@@ -54,9 +54,9 @@ class B_Queue:
def _open(self):
if self.fd == None:
if os.access(self.name, os.F_OK):
- self.fd = open(self.name, "r+") # noqa: SIM115 - held open for flock
+ self.fd = open(self.name, "r+", encoding="utf-8") # noqa: SIM115 - held open for flock
else:
- self.fd = open(self.name, "w+") # noqa: SIM115
+ self.fd = open(self.name, "w+", encoding="utf-8") # noqa: SIM115
def read(self):
self._open()
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/389ce5a31104551f35ba9b41daa82bb3d44c89ff
More information about the pld-cvs-commit
mailing list