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

Jeremy Kerr jk at ozlabs.org
Thu Feb 10 14:18:39 EST 2011


Hi Paul & Martin,

> > > I think this patch needs to be reapplied, after the branch change(?) in
> > > March 2010 [1].
> > 
> > Thanks, good catch, I've reapplied it.
> 
> This does now decode twice and raises an exception (on both paths).  I
> don't see a reason for the second time, but attached is a patch that
> makes it conditional.

I'm also having trouble finding where parse_patch will be passed anything but 
unicode. There are two call sites for parse_patch:

1) From find_content(), but we'd explicitly checked for a unicode type here

2) From main() in parser.py, but we're using sys.stdin.read().decode('utf-8'), 
which should also give us a unicode type.

Martin, could you explain what this fix was originally for? If so, I'll write 
a testcase. However, it seems to no longer be necessary.

Paul - I'd rather ensure we're checking passing the correct arguments in, 
rather than conditionally doing the fixup.

Cheers,


Jeremy


More information about the Patchwork mailing list