dazuiniu's blog

cat /dev/dazuiniu/random

bzr的locale问题

View Comments

刚装完bzr,却发现了下面的错误,真是讨厌啊。

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的setlocale改掉就可以了。diff如下:

--- bzr-old.py	2010-05-17 18:43:49.000000000 +0800
+++ bzr-new.py	2010-05-17 18:43:31.000000000 +0800
@@ -91,7 +91,7 @@

 try:
-    locale.setlocale(locale.LC_ALL, '')
+    locale.setlocale(locale.LC_ALL)
 except locale.Error, e:
     sys.stderr.write('bzr: warning: %s\n'
                      '  bzr could not set the application locale.\n'

但问题大嘴牛看了lib下的locale.py文件,

    def setlocale(category, value=None):
        """ setlocale(integer,string=None) -> string.
            Activates/queries locale processing.
        """
        if value not in (None, '', 'C'):
            raise Error, '_locale emulation only supports "C" locale'
        return 'C'

看到直接传入空串应该也是可以的啊,怎么会出错呢,罢了,反正现在OK了。

Written by dazuiniu

May 17th, 2010 at 6:56 pm

Posted in usage

Tagged with , ,

  • Ryan

    ==
    恰好也遇到了类似的问题。macport自动编译的东西总是会出现些神奇的问题……什么时候appstore能做得像ubuntu app center那样就好了…

  • Ryan

    顺便求,阁下的comment post插件名称…..很给力阿

blog comments powered by Disqus