[PATCH] pwclient: fix handling of UTF-8 char in submitter name

Wolfgang Denk wd at denx.de
Fri Dec 10 16:51:16 EST 2010


Dear Jeremy Kerr,

In message <201012101231.51075.jk at ozlabs.org> you wrote:
> > This patch fixes following bug in 'list':
> > 
> > ---8<---
> > # pwclient list -p uboot -w andreas.devel | grep New
> > Traceback (most recent call last):
> >   File "/Users/andreas/bin/pwclient", line 463, in <module>
> >     main()
> >   File "/Users/andreas/bin/pwclient", line 411, in main
> >     action_list(rpc, filt, submitter_str, delegate_str)
> >   File "/Users/andreas/bin/pwclient", line 182, in action_list
> >     (person['name'], person['email'])
> > UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in
> > position 32: ordinal not in range(128)
> > --->8---
> > 
> > Signed-off-by: Andreas Bießmann <andreas.devel at googlemail.com>
> 
> Nice catch, applied.

Hm...

When running this on the U-Boot list I now get sometimes things like
this:

Traceback (most recent call last):
  File "/home/wd/bin/pwparser", line 241, in <module>
    sys.exit(main(sys.argv))
  File "/home/wd/bin/pwparser", line 226, in main
    content = sys.stdin.read().decode('utf-8')
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xdf in position 478: invalid continuation byte


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There is is no reason for any individual to have a computer in  their
home.      -- Ken Olsen (President of Digital Equipment Corporation),
              Convention of the World Future Society, in Boston, 1977


More information about the Patchwork mailing list