Bug 1557336 - Unset LC_CTYPE when executing pipenv. r=chmanchester a=test-only
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Jun 2019 20:24:04 +0000
changeset 536912 73460fd9b68d7ddd5266cda0d0693ec4b15de14c
parent 536911 992cbc55ecf76c0117ea0ca081a53ec7178f019e
child 536913 0570584cae2a1dabadf9fba89d08d492a7199f62
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester, test-only
bugs1557336
milestone68.0
Bug 1557336 - Unset LC_CTYPE when executing pipenv. r=chmanchester a=test-only Differential Revision: https://phabricator.services.mozilla.com/D34484
python/mozbuild/mozbuild/virtualenv.py
--- a/python/mozbuild/mozbuild/virtualenv.py
+++ b/python/mozbuild/mozbuild/virtualenv.py
@@ -586,16 +586,20 @@ class VirtualenvManager(object):
         indicates the version of Python for pipenv to use.
         """
         pipenv = os.path.join(self.bin_path, 'pipenv')
         env = os.environ.copy()
         env.update({
             b'PIPENV_IGNORE_VIRTUALENVS': b'1',
             b'WORKON_HOME': str(os.path.normpath(os.path.join(self.topobjdir, '_virtualenvs'))),
         })
+        # On mac, running pipenv with LC_CTYPE set to "UTF-8" (which happens
+        # when wrapping with run-task on automation) fails.
+        # Unsetting it doesn't really matter for what pipenv does.
+        env.pop('LC_CTYPE', None)
 
         if python is not None:
             env[b'PIPENV_DEFAULT_PYTHON_VERSION'] = str(python)
             env[b'PIPENV_PYTHON'] = str(python)
 
         def ensure_venv():
             """Create virtual environment if needed and return path"""
             venv = get_venv()