[PATCH 2 of 5 stable] py3: fix bytes iteration
Manuel Jacob
me at manueljacob.de
Tue Jun 16 10:38:09 UTC 2020
On 2020-06-16 11:46, Yuya Nishihara wrote:
> On Tue, 16 Jun 2020 03:50:27 +0200, Manuel Jacob wrote:
>> # HG changeset patch
>> # User Manuel Jacob <me at manueljacob.de>
>> # Date 1592184624 -7200
>> # Mon Jun 15 03:30:24 2020 +0200
>> # Branch stable
>> # Node ID 343142bb73bafe1ad2a244905e63770fb31a0ee0
>> # Parent 0dddc84a6a1ac5bb027b66c12d79aa5916d2b05b
>> # EXP-Topic convert-svn
>> py3: fix bytes iteration
>>
>> diff --git a/hgext/convert/common.py b/hgext/convert/common.py
>> --- a/hgext/convert/common.py
>> +++ b/hgext/convert/common.py
>> @@ -87,7 +87,7 @@
>> def encodeargs(args):
>> def encodearg(s):
>> lines = base64.encodestring(s)
>> - lines = [l.splitlines()[0] for l in lines]
>> + lines = [l.splitlines()[0] for l in
>> pycompat.iterbytestr(lines)]
>> return b''.join(lines)
>
> This is fine, but the original code looks strange. Maybe it should do
> b''.joins(lines.splitlines()) to remove '\n's?
Considering that the tests for this module don’t run on Python 3 in any
CI in the moment, I’d like to postpone further cleanups.
More information about the Mercurial-devel
mailing list