[PATCH] Decode patch from UTF-8 while parsing from stdin

Guilherme Salgado 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
> though.
> 
> 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...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/patchwork/attachments/20110210/c2a0d021/attachment.pgp>


More information about the Patchwork mailing list