[f22-branch 1/1] Don't use $LANGUAGE if empty (#1222262)

dashea installerbot-noreply at redhat.com
Mon May 18 15:03:59 UTC 2015


From: David Shea <dshea at redhat.com>

KDE sets $LANGUAGE to an empty string for some mysterious reason, and
they know about it, and they ain't gonna fix it. Ignore $LANGUAGE if
it's an empty string because a careful reading of the man page says that
$LANGUAGE only counts if it contains something and an empty $LANGUAGE
breaks everything.
---
 anaconda | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/anaconda b/anaconda
index c17c797..6b831ed 100755
--- a/anaconda
+++ b/anaconda
@@ -1224,8 +1224,12 @@ if __name__ == "__main__":
     # ability to set the language and locale after startup. If any of, in
     # order, $LANGUAGE, $LC_ALL, or $LC_MESSAGES is in the environment, copy
     # the information to $LANG, and then clear the rest.
+
+    # The variables only count if not empty, and some programs (KDE) insist
+    # on setting empty language variables, which would break if we actually
+    # tried to use them.
     for varname in ("LANGUAGE", "LC_ALL", "LC_MESSAGES"):
-        if varname in os.environ:
+        if varname in os.environ and os.environ[varname]:
             os.environ["LANG"] = os.environ[varname] # pylint: disable=environment-modify
             break
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/ba34ebfbc2b6e11d5e16c543c590cd83bdbae175


More information about the anaconda-patches mailing list