Repository: tox-dev/tox

Issue:
Add `LANGUAGE` env var to default pass list
Since tox 2.0.2 `LANG` is automatically passed to avoid Unicode(En|De)codeErrors. I've just now encountered a system (macOS) where `LANGUAGE` was used instead of `LANG`, again causing test breakage.

I would suggest to add `LANGUAGE` to the list of default pass variables.

Discussion:

Patch:
diff --git a/doc/config.txt b/doc/config.txt
index dc13ba82..3b6d66dc 100644
--- a/doc/config.txt
+++ b/doc/config.txt
@@ -212,10 +212,10 @@ Complete list of settings that you can put into ``testenv*`` sections:
    You can use ``*`` and ``?`` to match multiple environment variables with
    one name.
 
-   Note that the ``PATH``, ``LANG`` and ``PIP_INDEX_URL`` variables are
-   unconditionally passed down and on Windows ``SYSTEMROOT``, ``PATHEXT``,
-   ``TEMP`` and ``TMP`` will be passed down as well whereas on unix
-   ``TMPDIR`` will be passed down.  You can override these variables
+   Note that the ``PATH``, ``LANG``, ``LANGUAGE`` and ``PIP_INDEX_URL``
+   variables are unconditionally passed down and on Windows ``SYSTEMROOT``,
+   ``PATHEXT``, ``TEMP`` and ``TMP`` will be passed down as well whereas on
+   unix ``TMPDIR`` will be passed down.  You can override these variables
    with the ``setenv`` option.
 
    If defined the ``TOX_TESTENV_PASSENV`` environment variable (in the tox
diff --git a/tox/config.py b/tox/config.py
index a02c34ea..a66e5892 100755
--- a/tox/config.py
+++ b/tox/config.py
@@ -454,7 +454,9 @@ def tox_addoption(parser):
             itertools.chain.from_iterable(
                 [x.split(' ') for x in value]))
 
-        passenv = set(["PATH", "PIP_INDEX_URL", "LANG", "LD_LIBRARY_PATH"])
+        passenv = set([
+            "PATH", "PIP_INDEX_URL", "LANG", "LANGUAGE", "LD_LIBRARY_PATH"
+        ])
 
         # read in global passenv settings
         p = os.environ.get("TOX_TESTENV_PASSENV", None)


Test patch:
diff --git a/tests/test_config.py b/tests/test_config.py
index a7563751..e1226d43 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -869,6 +869,7 @@ class TestConfigTestEnv:
         assert "PATH" in envconfig.passenv
         assert "PIP_INDEX_URL" in envconfig.passenv
         assert "LANG" in envconfig.passenv
+        assert "LANGUAGE" in envconfig.passenv
         assert "LD_LIBRARY_PATH" in envconfig.passenv
         assert "A123A" in envconfig.passenv
         assert "A123B" in envconfig.passenv
@@ -898,6 +899,7 @@ class TestConfigTestEnv:
         assert "PATH" in envconfig.passenv
         assert "PIP_INDEX_URL" in envconfig.passenv
         assert "LANG" in envconfig.passenv
+        assert "LANGUAGE" in envconfig.passenv
         assert "A123A" in envconfig.passenv
         assert "A123B" in envconfig.passenv