Ask Your Question
0

Unable to build documentation (ValueError: unknown locale: UTF-8)

asked 2014-12-03 08:13:52 +0100

updated 2015-01-14 12:02:51 +0100

FrédéricC gravatar image

When I try to build the sage documentation I get an error. What am I doing wrong? The same error appears when I try

make doc-clean && make

Here is a transcript:

amri@as154:~/sage$ sage -docbuild
Traceback (most recent call last):
  File "/home/amri/sage/src/doc/common/builder.py", line 16, in <module>
    import sphinx.cmdline
  File "/home/amri/sage/local/lib/python2.7/site-packages/Sphinx-1.2.2-py2.7.egg/sphinx/cmdline.py", line 18, in <module>
    from docutils.utils import SystemMessage
  File "/home/amri/sage/local/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
    import docutils.io
  File "/home/amri/sage/local/lib/python2.7/site-packages/docutils/io.py", line 18, in <module>
    from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
  File "/home/amri/sage/local/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
    locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
  File "/home/amri/sage/local/lib/python/locale.py", line 543, in getdefaultlocale
    return _parse_localename(localename)
  File "/home/amri/sage/local/lib/python/locale.py", line 475, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
edit retag flag offensive close merge delete

Comments

Which operating system are you using (which distribution) ? What is the output of the following command (on a terminal):

echo LC_ALL $LC_ALL LC_CTYPE $LC_CTYPE LANG $LANG LANGUAGE $LANGUAGE
tmonteil gravatar imagetmonteil ( 2014-12-03 09:32:53 +0100 )edit

I get: LC_ALL LC_CTYPE UTF-8 LANG en_IN LANGUAGE en_IN:en

I am using ubuntu 14.04 LTS

Amri gravatar imageAmri ( 2014-12-03 11:26:15 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2014-12-03 12:33:21 +0100

tmonteil gravatar image

updated 2014-12-03 12:34:10 +0100

You locales look weird. You should have a look at the sudo update-locale and at the sudo dpkg-reconfigure locales ubuntu commands (search on the web to see what they do). If you do not want to touch that, a quick workaround is to type:

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

You can add those lines to your ~/.bashrc file.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-12-03 08:13:52 +0100

Seen: 1,445 times

Last updated: Dec 03 '14