From 5d6dfd8981ac9ab65012de0e9a9ed26301e5b8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 19 Dec 2025 09:31:46 +0100 Subject: [PATCH] authenticate: Improve error replies. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/authenticate.scm (guix-authenticate)[send-reply]: Wrap guard in ‘with-fluids’. Call ‘string-trim-right’ on the message string of ‘c’. Change-Id: I6ab5f645f2dc9d6f53bb57eabb4de1df8212892f Signed-off-by: Ludovic Courtès --- guix/scripts/authenticate.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/guix/scripts/authenticate.scm b/guix/scripts/authenticate.scm index 45f62f6ebc2..48e76c61c8a 100644 --- a/guix/scripts/authenticate.scm +++ b/guix/scripts/authenticate.scm @@ -161,10 +161,14 @@ by colon, followed by the given number of characters." ;; Send a reply for the result of THUNK or for any exception raised during ;; its execution. (guard (c ((formatted-message? c) - (send-reply (reply-code command-failed) - (apply format #f - (G_ (formatted-message-string c)) - (formatted-message-arguments c))))) + ;; Make sure the translated message can be written to standard + ;; output as ISO-8859-1 no matter what (XXX). + (with-fluids ((%default-port-conversion-strategy 'substitute)) + (send-reply (reply-code command-failed) + (apply format #f + (string-trim-right + (G_ (formatted-message-string c))) + (formatted-message-arguments c)))))) (send-reply (reply-code success) (thunk)))) (define-syntax-rule (with-reply exp ...)