]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
testsuite: force C locale in reverse-daemon-delta byte-count parse
authorAndrew Tridgell <andrew@tridgell.net>
Sat, 13 Jun 2026 06:51:24 +0000 (16:51 +1000)
committerAndrew Tridgell <andrew@tridgell.net>
Sat, 13 Jun 2026 08:56:32 +0000 (18:56 +1000)
rsync groups the "sent/received N bytes" summary numbers using the
locale's thousands separator (e.g. de_DE uses '.'), which broke the
[\d,]+ parser and failed the test for testers in non-C locales. Run the
peer client under LC_ALL=C so the output is deterministic.

Reported-by: Michael Mess <michael@michaelmess.de>
testsuite/reverse-daemon-delta_test.py

index 707977ddc8562f57ae768799725e7df2dccb8613..b073b5784cfddb256a88d68d8cab5562f5f86946 100644 (file)
@@ -57,8 +57,11 @@ def peer_client(args, label):
     """Run the OLD client (RSYNC_PEER) and return (sent, received) wire bytes
     parsed from rsync's summary line. Fails the test on non-zero exit."""
     argv = shlex.split(RSYNC_PEER) + args
+    # Force C locale: rsync groups the "sent/received N bytes" numbers per the
+    # locale (e.g. de_DE uses '.' for thousands), which would break parsing.
     proc = subprocess.run(argv, stdout=subprocess.PIPE,
-                          stderr=subprocess.STDOUT, text=True)
+                          stderr=subprocess.STDOUT, text=True,
+                          env={**os.environ, 'LC_ALL': 'C'})
     print(proc.stdout, end='')
     if proc.returncode != 0:
         test_fail(f"{label}: old client exited {proc.returncode}")