ValueError: unknown locale: UTF-8

Traceback (most recent call last):
  File "/usr/local/bin/sphinx-build", line 11, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/sphinx/__init__.py", line 51, in main
    sys.exit(build_main(argv))
  File "/Library/Python/2.7/site-packages/sphinx/__init__.py", line 61, in build_main
    from sphinx import cmdline
  File "/Library/Python/2.7/site-packages/sphinx/cmdline.py", line 19, in <module>
    from docutils.utils import SystemMessage
  File "/Library/Python/2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
    import docutils.io
  File "/Library/Python/2.7/site-packages/docutils/io.py", line 18, in <module>
    from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
  File "/Library/Python/2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
    locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 511, in getdefaultlocale
    return _parse_localename(localename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 443, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
make[2]: *** [html] Error 1
make[1]: *** [install-doc] Error 2

make: *** [git-cola.app] Error 2



Solution

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8