From 0bcf87df3848487abc5d425e0c3ed84919cd7d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= Date: Wed, 8 Apr 2026 13:48:42 +0200 Subject: [PATCH] Bug 42302: Fix xgettext.pl's STDOUT output xgettext.pl tries to produce output to STDOUT by default, but fails because of an error in the code. It should go to the actual STDOUT instead of a file named '&STDOUT'. Test plan: 1. Run xgettext.pl: echo koha-tmpl/opac-tmpl/bootstrap/en/includes/serial-status.inc > transfiles ./misc/translator/xgettext.pl -vaf transfiles 2. Observe no standard output, and the existence of a file called `&STDOUT`. Output to the screen is: echo koha-tmpl/opac-tmpl/bootstrap/en/includes/serial-status.inc > transfiles kohadev-koha@kohadevbox:koha(main)$ ./misc/translator/xgettext.pl -vaf transfiles ./misc/translator/xgettext.pl: Outputting to STDOUT... ./misc/translator/xgettext.pl: Opening input file list "transfiles" ./misc/translator/xgettext.pl: Processing file "./koha-tmpl/opac-tmpl/bootstrap/en/includes/serial-status.inc" 3. Apply the patch. 4. Run again. 5. Observe that information is output to the screen (see example of outpunt in the bug comment). Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass --- misc/translator/xgettext.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index 898fc4b85a..f733aa8643 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -380,7 +380,7 @@ if ( defined $output && $output ne '-' ) { open( $OUTPUT, '>:encoding(utf-8)', $output ) || die "$output: $!\n"; } else { print STDERR "$0: Outputting to STDOUT...\n" if $verbose_p; - open( $OUTPUT, q{>}, "&STDOUT" ); + $OUTPUT = *STDOUT; } if ( defined $files_from ) {