Closed Bug 1124198 Opened 9 years ago Closed 9 years ago

Running mach build-docs gives: ValueError: unknown locale: UTF-8

Categories

(Firefox Build System :: Mach Core, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: gfritzsche, Unassigned)

Details

This is on OS X 10.9.

colossus:mc1 gfritzsche$ ./mach build-docs
Collecting sphinx-rtd-theme==0.1.6
  Downloading sphinx_rtd_theme-0.1.6-py27-none-any.whl (217kB)
    100% |################################| 221kB 4.1MB/s 
Collecting sphinx>=1.1 (from sphinx-rtd-theme==0.1.6)
  Downloading Sphinx-1.2.3-py2-none-any.whl (1.9MB)
    100% |################################| 1.9MB 1.2MB/s 
Collecting Pygments>=1.2 (from sphinx>=1.1->sphinx-rtd-theme==0.1.6)
  Downloading Pygments-2.0.2-py2-none-any.whl (672kB)
    100% |################################| 675kB 4.3MB/s 
Collecting docutils>=0.7 (from sphinx>=1.1->sphinx-rtd-theme==0.1.6)
  Downloading docutils-0.12.tar.gz (1.6MB)
    100% |################################| 1.6MB 4.2MB/s 
Collecting Jinja2>=2.3 (from sphinx>=1.1->sphinx-rtd-theme==0.1.6)
  Downloading Jinja2-2.7.3.tar.gz (378kB)
    100% |################################| 380kB 3.6MB/s 
Collecting markupsafe (from Jinja2>=2.3->sphinx>=1.1->sphinx-rtd-theme==0.1.6)
  Downloading MarkupSafe-0.23.tar.gz
Installing collected packages: markupsafe, Jinja2, docutils, Pygments, sphinx, sphinx-rtd-theme
  Running setup.py install for markupsafe
    building 'markupsafe._speedups' extension
    clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c markupsafe/_speedups.c -o build/temp.macosx-10.9-x86_64-2.7/markupsafe/_speedups.o
    clang -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.9-x86_64-2.7/markupsafe/_speedups.o -o build/lib.macosx-10.9-x86_64-2.7/markupsafe/_speedups.so
  Running setup.py install for Jinja2
  Running setup.py install for docutils
    changing mode of build/scripts-2.7/rst2html.py from 644 to 755
    changing mode of build/scripts-2.7/rst2s5.py from 644 to 755
    changing mode of build/scripts-2.7/rst2latex.py from 644 to 755
    changing mode of build/scripts-2.7/rst2xetex.py from 644 to 755
    changing mode of build/scripts-2.7/rst2man.py from 644 to 755
    changing mode of build/scripts-2.7/rst2xml.py from 644 to 755
    changing mode of build/scripts-2.7/rst2pseudoxml.py from 644 to 755
    changing mode of build/scripts-2.7/rstpep2html.py from 644 to 755
    changing mode of build/scripts-2.7/rst2odt.py from 644 to 755
    changing mode of build/scripts-2.7/rst2odt_prepstyles.py from 644 to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rst2html.py to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rst2latex.py to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rst2man.py to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rst2odt.py to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rst2odt_prepstyles.py to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rst2pseudoxml.py to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rst2s5.py to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rst2xetex.py to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rst2xml.py to 755
    changing mode of /Users/gfritzsche/moz/mc1/obj/_virtualenv/bin/rstpep2html.py to 755



Successfully installed Jinja2-2.7.3 Pygments-2.0.2 docutils-0.12 markupsafe-0.23 sphinx-1.2.3 sphinx-rtd-theme-0.1.6
Error running mach:

    ['build-docs']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

ValueError: unknown locale: UTF-8

  File "/Users/gfritzsche/moz/mc1/tools/docs/mach_commands.py", line 45, in build_docs
    return sphinx.main(args)
  File "/Users/gfritzsche/moz/mc1/obj/_virtualenv/lib/python2.7/site-packages/sphinx/__init__.py", line 47, in main
    sys.exit(build_main(argv))
  File "/Users/gfritzsche/moz/mc1/obj/_virtualenv/lib/python2.7/site-packages/sphinx/__init__.py", line 56, in build_main
    from sphinx import cmdline
  File "/Users/gfritzsche/moz/mc1/obj/_virtualenv/lib/python2.7/site-packages/sphinx/cmdline.py", line 18, in <module>
    from docutils.utils import SystemMessage
  File "/Users/gfritzsche/moz/mc1/obj/_virtualenv/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
    import docutils.io
  File "/Users/gfritzsche/moz/mc1/obj/_virtualenv/lib/python2.7/site-packages/docutils/io.py", line 18, in <module>
    from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
  File "/Users/gfritzsche/moz/mc1/obj/_virtualenv/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
    locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 511, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 443, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
This seems to be a Python or OS X Terminal issue:
> The locale thing is a bug in the OS X terminal (it's too bad that
> Mavericks hasn't fixed this bug already). The issue is that Terminal
> sets LANG incorrectly. The workaround (still to be verified if it
> works) is to uncheck the "Set LANG environment variable on startup"
> setting in Terminal. See https://code.djangoproject.com/ticket/5846.
> We're unsure how to fix this because it's not clear what LANG should
> be set to (en_US.UTF-8 is only correct if you are in the United
> States).
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.