bzr-email fails if committer has non-ascii gecos

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Aug 28 10:19:49 UTC 2013


>>>>> Glenn Morris <rgm at gnu.org> writes:

    > Looking at _auto_user_id in config.py, which is what prints "cannot
    > decode passwd entry"), it already defaults to utf-8, only trying
    > get_user_encoding if utf-8 fails.

    > It seems like the lack of the locale package is indeed the problem.
    > A minimal example that shows the issue is:

    >   #!/usr/bin/python
    >   # -*- coding: utf-8 -*-
    >   string = 'Belaïche'
    >   print string.decode('utf-8')

    > (if my mail client mangled that, there is supposed to be a "LATIN SMALL
    > LETTER I WITH DIAERESIS" in string).

    > That works fine on my laptop, but if I uninstall the locales package, it
    > starts to fail with the same error as it does on Savannah:

    >   UnicodeEncodeError: 'ascii' codec can't encode character u'\xef' in
    >   position 4: ordinal not in range(128)

Urgh, you mean python can't decode utf8 if locales is not installed ?

Could it be that python chokes on importing your source rather than not
being able to decode utf8 from an external file ?

Do you still encounter the issue with:

 string = u'Bela\xefche'


    > So I guess I should install locales...

Given your diagnostic that sounds like the right solution but I find it
really weird that python fails this way.

       Vincent



More information about the bazaar mailing list