[PATCH] Decode patch from UTF-8 while parsing from stdin
guilherme.salgado at linaro.org
Fri Feb 11 02:55:30 EST 2011
On Thu, 2011-02-10 at 15:43 +0100, martin f. krafft wrote:
> also sprach Guilherme Salgado <guilherme.salgado at linaro.org> [2011.02.10.1302 +0100]:
> > If indeed parse_patch() will only be passed unicode objects, having it
> > call text.decode('utf8') is wrong because that will cause an implicit
> > encoding of text using the default codec (ascii), which will fail if
> > text has any non-ascii characters.
> True, but I am sure there was another reason. I cannot remember it
> Has someone tried submitting a patch with Unicode? Maybe it does
> work now…
It's actually the other way around -- it works if we remove
the .decode('utf-8') from parse_patch(). With the decode() there the
tests that try parsing email addresses with non-ascii stuff (e.g.
patchwork.tests.patchparser.UTF8InlinePatchTest) fail but if we remove
the .decode('utf-8') they pass.
Guilherme Salgado <https://launchpad.net/~salgado>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: This is a digitally signed message part
More information about the Patchwork