# HG changeset patch # User Ian Moody # Date 2019-03-08 23:45:12 # Node ID 47125193bad0ee8e8a977d7dfe1ee9f710b0718a # Parent 9a8c7c17d816913ed5c44845912491558bee7520 py3: convert indexes into bytes when enumerating lists in urlencodenested Otherwise it'll try to insert them them into a %s slot in a b'' later and fail. Differential Revision: https://phab.mercurial-scm.org/D6105 diff --git a/hgext/phabricator.py b/hgext/phabricator.py --- a/hgext/phabricator.py +++ b/hgext/phabricator.py @@ -161,7 +161,8 @@ def urlencodenested(params): def process(prefix, obj): if isinstance(obj, bool): obj = {True: b'true', False: b'false'}[obj] # Python -> PHP form - items = {list: enumerate, dict: lambda x: x.items()}.get(type(obj)) + lister = lambda l: [(b'%d' % k, v) for k, v in enumerate(l)] + items = {list: lister, dict: lambda x: x.items()}.get(type(obj)) if items is None: flatparams[prefix] = obj else: