Adding sanity check for locale setting

Review Request #3296 - Created Jan. 5, 2016 and submitted

Information
Eric Ayers
pants
zundel/check-locale
2465, 2769
9295e7d...
Reviewers
pants-reviews
jsirois, kwlzn

If the environment had an invalid locale setting, Pants would fail deep inside a 3rdparty library.

This change adds an explicit test for a valid locale early in pants startup to give users better feedback about this setup problem.

Now an error like this prints:

Traceback (most recent call last):
  File "/Users/zundel/Src/Pants/src/python/pants/bin/pants_exe.py", line 35, in <module>
    "    LANG=en_US.UTF-8".format(type(e).__name__, e))
__main__.InvalidLocaleError: ValueError: unknown locale: ou812
  Could not get a valid locale. Check LC_* and LANG environment settings.
  Example for US English:
    LC_ALL=en_US.UTF-8
    LANG=en_US.UTF-8

CI is green at https://travis-ci.org/pantsbuild/pants/builds/100367350
Added an integration test

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Eric Ayers
Kris Wilson
Eric Ayers
Eric Ayers
Kris Wilson
Eric Ayers
Eric Ayers
Review request changed

Status: Closed (submitted)

Change Summary:

Thanks Kris. Commit 6746e3f

Loading...