Opened 15 years ago

Closed 14 years ago

#20730 closed defect (fixed)

Mercurial appears to require LANG and LC_ALL set to UTF8

Reported by: ora.et.labora@… Owned by: deric@…
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc:
Port: mercurial

Description

According to Mercurial's documention one needs to set environment variables like

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

in order to lift off. Otherwise, disaster strikes.

Change History (5)

comment:1 Changed 15 years ago by nerdling (Jeremy Lavergne)

Cc: deric@… added
Keywords: hg utf8 mercurial removed
Priority: HighNormal

comment:2 Changed 15 years ago by jmroot (Joshua Root)

Cc: deric@… removed
Owner: changed from macports-tickets@… to deric@…

comment:3 Changed 15 years ago by vinc17@…

The documentation doesn't give much information. Without using UTF-8, I've never seen any problem with Mercurial (but I don't do commits).

comment:4 Changed 15 years ago by yaseppochi (Stephen J. Turnbull)

You probably also live in an ASCII-speaking territory. Here's what happens in Japan:

wideload:src/MacPorts 23:38$ hg version        
Traceback (most recent call last):
  File "/opt/local/bin/hg", line 27, in <module>
    mercurial.dispatch.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 27, in dispatch
    return _runcatch(u, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 144, in _runcatch
    ui.warn(_("** unknown exception encountered, details follow\n"))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/i18n.py", line 43, in gettext
    return u.encode(encoding.encoding, "replace")
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/demandimport.py", line 75, in __getattribute__
    self._load()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/demandimport.py", line 47, in _load
    mod = _origimport(head, globals, locals)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/encoding.py", line 20, in <module>
    encoding = locale.getlocale()[1]
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py", line 497, in getlocale
    return _parse_localename(localename)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py", line 410, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

Mercurial is the only Python app that does this to me. Even more brain-damaged, to override this you must set LC_CTYPE or LC_ALL. LANG is not good enough.

Mac OS X 10.5.8 "Leopard"
MacBook Pro (Intel Core Duo)
MacPorts from svn (up to date at r57210; port last built and installed about 2009/09/02)
mercurial @1.3.1_0 (active)

comment:5 Changed 14 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

1.4 (r60767) release notes say this is fixed.

Note: See TracTickets for help on using tickets.