[MERGE] Running bzr from vim scripts gives 'unknown encoding warning'

Martin Pool mbp at canonical.com
Wed May 21 08:47:05 BST 2008


On Tue, May 6, 2008 at 12:45 PM, Neil Martinsen-Burrell
<nmb at wartburg.edu> wrote:
> I can't figure out the difference between "python -c "import locale; print
> locale.getpreferredencoding" and the corresponding line in osutils.py,
> particularly in a way that only appears under gvim.

Maybe it is due to this preceding code in get_user_encoding, which has
a somewhat obscure comment:

    if sys.platform == 'darwin':
        # work around egregious python 2.4 bug
        sys.platform = 'posix'
        try:
            import locale
        finally:
            sys.platform = 'darwin'
    else:
        import locale

John explains on 2006-2-20 as:

## Which basically forces python to honor the LANG setting, ## even on
Mac. On other platforms, it does the right thing. ## On Mac it is
(incorrectly?)
## hardcoded to Mac-Roman because of legacy issues.

If this has been fixed after 2.5 which the comment seems to imply then
maybe we should check the Python version too?

On the whole I agree with Ian that it would be an advance to put it
in; I'll merge it and also add something to news.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list