[PATCH 1 of 4 py3 v2] encoding: make encoding.encoding be a native str and add encodingb

Augie Fackler raf at durin42.com
Sun Mar 12 18:42:06 EDT 2017


> On Mar 12, 2017, at 15:10, Augie Fackler <raf at durin42.com> wrote:
> 
> 
>> On Mar 12, 2017, at 15:08, Yuya Nishihara <yuya at tcha.org> wrote:
>> 
>> On Sun, 12 Mar 2017 17:51:15 -0400, Augie Fackler wrote:
>>> # HG changeset patch
>>> # User Augie Fackler <augie at google.com>
>>> # Date 1489303712 14400
>>> #      Sun Mar 12 03:28:32 2017 -0400
>>> # Node ID 4455c6cdbf1e9cd524b43c69ecefef819e0b4e30
>>> # Parent  7dd2f51f38ac224cec522d093ff6f805beb0dd3e
>>> encoding: make encoding.encoding be a native str and add encodingb
>>> 
>>> It turns out we need the encoding name both ways. Ugh.
>>> 
>>> diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
>>> --- a/mercurial/debugcommands.py
>>> +++ b/mercurial/debugcommands.py
>>> @@ -965,7 +965,7 @@ def debuginstall(ui, **opts):
>>>    fm.startitem()
>>> 
>>>    # encoding
>>> -    fm.write('encoding', _("checking encoding (%s)...\n"), encoding.encoding)
>>> +    fm.write('encoding', _("checking encoding (%s)...\n"), encoding.encodingb())
>> 
>> We have much more uses of encoding.encoding expecting bytes. Better to make
>> encodingu() a function?
>> 
>> % grep encoding.encoding **/*.py | grep -v sysstr | wc -l
>> 41
> 
> Sure, I'll roll a v3.

I decided to drop the encoding{b,u} idea for now, but maybe we should do it since a lot of places use sysstr()? Anyway, v3 coming shortly.


More information about the Mercurial-devel mailing list