[PATCH 2 of 2] py3: convert unicode paths given for hgweb config

Ludovic Chabant ludovic at chabant.com
Tue Apr 23 11:20:05 EDT 2019


> > If we want to be consistent with other things like the hgclient API,
> > maybe we shouldn't be nice and encode the string for the caller, and
> > instead reject anything that's not bytes?
> 
> Sounds good to reject unicodes explicitly.

I had sent a v2 of my patch with a better way to encode the string, but now that I'm checking the hgclient code I don't think it explicitly rejects unicode strings? I think it just dies very quickly as soon as it tries to concatenate a string and a bytes.
Is there some other precedent for rejecting arguments explicitly? Is it just about raising some ValueError exception?


More information about the Mercurial-devel mailing list