[PATCH 1 of 3 v2] hghave: matchoutput needs to use bytes for regexp

Yuya Nishihara yuya at tcha.org
Wed May 11 08:35:25 EDT 2016


On Mon, 9 May 2016 16:28:27 +0200, Pierre-Yves David wrote:
> On 05/08/2016 10:28 PM, timeless wrote:
> > # HG changeset patch
> > # User timeless <timeless at mozdev.org>
> > # Date 1462439221 0
> > #      Thu May 05 09:07:01 2016 +0000
> > # Node ID 18ef4f2e901adfba72054641bf5bfa21aa64a17e
> > # Parent  57a24a85a2bc484cbd7c4b80959dc2d5f0483174
> > # Available At bb://timeless/mercurial-crew
> > #              hg pull bb://timeless/mercurial-crew -r 18ef4f2e901a
> > hghave: matchoutput needs to use bytes for regexp
> >
> > file output is bytes in py3, so we need to convert the regexp to bytes  
> 
> Shouln't we ensure the callers are passing bytes instead? (by adding b 
> prefix to string).
> Implicite conversion of string to bytes in function iternal seems like a 
> bad idea.

+1 for b'' or br''. Anyway, we'll have to do that for all string literals
in the core modules.


More information about the Mercurial-devel mailing list