bzr: warning: unsupported locale setting on Mac OS X

Bug #339123 reported by Stuart Colville on 2009-03-07
36
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Bazaar
Low
Unassigned

Bug Description

After upgrading to 1.12 I get the following warning running any bzr command

I'm running bzr on mac osx 10.5.6

$ bzr --version
bzr: warning: unsupported locale setting
  bzr could not set the application locale.
  Although this should be no problem for bzr itself,
  it might cause problems with some plugins.
  To investigate the issue, look at the output
  of the locale(1p) tool available on POSIX systems.
bzr: warning: unsupported locale setting
  Could not determine what text encoding to use.
  This error usually means your Python interpreter
  doesn't support the locale set by $LANG (en_GB.UTF-8)
  Continuing with ascii encoding.
Bazaar (bzr) 1.12
  Python interpreter: /System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python 2.5.1
  Python standard library: /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
  bzrlib: /Library/Python/2.5/site-packages/bzrlib
  Bazaar configuration: /Users/scol/.bazaar
  Bazaar log file: /Users/scol/.bzr.log

The output of locale is as follows:

$ locale
LANG="en_GB.UTF-8"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

If I run export LANG=

The error messages disappear when running bzr commands again.

bzr log output for these commands are as follows:

Sat 2009-03-07 11:38:25 +0000
0.101 bzr arguments: [u'--version']
0.114 encoding stdout as sys.stdout encoding 'US-ASCII'
0.221 return code 0

Sat 2009-03-07 11:39:38 +0000
0.107 bzr arguments: [u'--version']
0.120 encoding stdout as sys.stdout encoding 'US-ASCII'
0.227 return code 0

Seems this is fixed by:

export LC_ALL=C

Marking as invalid as I can't be sure it was as a result of the upgrade.

Changed in bzr:
status: New → Invalid

Re-opening this as I've since seen this on numerous boxes - not sure it's a bug in bzr or as the result of something else changing though.

Changed in bzr:
status: Invalid → New
Martin Pool (mbp) wrote :

On Ubuntu, an error like this typically means you need to install the package 'language-pack-en' that provides the locale file for this LANG. I realize it won't be quite the same on Mac OS X, but it's probably something like that. I am surprised though that it's not already present.

tags: added: locale mac
summary: - bzr: warning: unsupported locale setting
+ bzr: warning: unsupported locale setting on Mac OS

Could you please post the output of this command:

python -c 'import locale; print locale.getpreferredencoding(), locale.getlocale()'

Changed in bzr:
importance: Undecided → Low
status: New → Confirmed

I don't have a mac any more but I got a colleague who's experiencing the same problem to run the command - the output was:

US-ASCII (None, None)

OK, that's interesting - I thought it might raise an error. I think
this is the same function we're running inside bzr, so either I'm
wrong and the exception comes from somewhere else, or the special
things we do on os x to try to work around other problems are in fact
causing this.

Hi guys,

I get this error on debian unstable (sid). It's not really a problem, it's just annoying =) Thought you might want to know. Anyway, the warnings show when i try to pull from a remote branch, not when doing --version. I'm running bzr 2.0.2 and python 2.5.4.

I think this is an error, because on my Ubuntu machines with bazaar 2.0.1 there are no problems, although they use the the exact same locale settings.

[andreas@debian]:~/src/kernel/nqn-->
# bzr pull
Using saved parent location: bzr+ssh://<scrambled>
bzr: warning: unsupported locale setting
  bzr could not set the application locale.
  Although this should be no problem for bzr itself,
  it might cause problems with some plugins.
  To investigate the issue, look at the output
  of the locale(1p) tool available on POSIX systems.
bzr: warning: unsupported locale setting
  Could not determine what text encoding to use.
  This error usually means your Python interpreter
  doesn't support the locale set by $LANG (en_DK.UTF-8)
  Continuing with ascii encoding.
No revisions to pull.

Bazaar/python version:
[andreas@debian]:~/src/kernel/nqn-->
# bzr --version
Bazaar (bzr) 2.0.2
  Python interpreter: /usr/bin/python 2.5.4
  Python standard library: /usr/lib/python2.5
  Platform: Linux-2.6.31-1-amd64-x86_64-with-debian-squeeze-sid
  bzrlib: /usr/lib/python2.5/site-packages/bzrlib
  Bazaar configuration: /home/andreas/.bazaar
  Bazaar log file: /home/andreas/.bzr.log

Copyright 2005, 2006, 2007, 2008, 2009 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Python locale snippet:
[andreas@debian]:~/src/kernel/nqn-->
# python -c 'import locale; print locale.getpreferredencoding(), locale.getlocale()'
UTF-8 (None, None)

Regards,
Andreas

summary: - bzr: warning: unsupported locale setting on Mac OS
+ bzr: warning: unsupported locale setting on Mac OS and Debian Sid

On Sat, 2009-11-07 at 08:35 +0000, Andreas Hindborg wrote:
> Hi guys,
>
> I get this error on debian unstable (sid). It's not really a problem,
> it's just annoying =) Thought you might want to know. Anyway, the
> warnings show when i try to pull from a remote branch, not when doing
> --version. I'm running bzr 2.0.2 and python 2.5.4.

Your remote server is missing your locale, or your ssh client isn't
passing the locale across correctly.

Please file a *new bug*, as this is not the same issue (at all) as the
Mac OS X issue we're tracking.

Thanks,
Rob

summary: - bzr: warning: unsupported locale setting on Mac OS and Debian Sid
+ bzr: warning: unsupported locale setting on Mac OS X

Hi,

I have the same problem on a new OSX Leopard installation. The python line in #5 gives:

 (None, None)

And my locale output:

LANG="UTF-8"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

I think OSX just doesn't set this variable correctly. We should either set it or find another way to query the locale in bzr...

INADA Naoki (songofacandy) wrote :

I think bzr should prvide a way to specify user_encoding.
I think having ``BZR_USERENCODING`` environment variable and ``user_encoding``
in configuration is nice option.

On 14 December 2010 16:55, INADA Naoki <email address hidden> wrote:
> I think bzr should prvide a way to specify user_encoding.
> I think having ``BZR_USERENCODING`` environment variable and ``user_encoding``
> in configuration is nice option.

I agree; I think there is a bug for this.
--
Martin

Jelmer Vernooij (jelmer) on 2017-11-09
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers