From 0c30bd2840f09458a47937c4a420cb34d3d6745e Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 3 May 2020 00:21:24 +0100 Subject: [PATCH] tests/dtest.py: Force a sensble locale if we don't have one. Otherwise the server gets sad when it tries to convert track names containing non-ASCII characters. I picked `C.UTF-8' as being available even when not explicitly configured. --- tests/dtest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/dtest.py b/tests/dtest.py index ffb63cb..0cb968a 100644 --- a/tests/dtest.py +++ b/tests/dtest.py @@ -54,6 +54,13 @@ ospath.insert(0, os.path.join(top_builddir, "clients")) ospath.insert(0, os.path.join(top_builddir, "tests")) os.environ["PATH"] = os.pathsep.join(ospath) +# Some of our track names contain non-ASCII characters, and the server will +# be sad if it can't convert them according to the current locale. Make sure +# we have something plausible. +locale = os.environ.get("LANG") +if locale is None or locale == "C" or locale == "POSIX": + os.environ["LANG"] = "C.UTF-8" + # Parse the makefile in the current directory to identify the source directory top_srcdir = None for l in file("Makefile"): -- 2.11.0