# HG changeset patch # User Pierre-Yves David # Date 2023-08-29 22:50:28 # Node ID 35885dbdc927726bdc2aba0b89916e1d282c0a10 # Parent ceac1bd816f72163182e6259067202068f50e82b path-suboption: deprecated specifying the attributes as bytes The known suboptions have been updated, so we can deprecated passing bytes in case some extensions use them. diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py +++ b/mercurial/utils/urlutil.py @@ -18,6 +18,7 @@ from .. import ( error, pycompat, urllibcompat, + util, ) from . import ( @@ -681,6 +682,10 @@ def pathsuboption(option, attr, display= This decorator can be used to perform additional verification of sub-options and to change the type of sub-options. """ + if isinstance(attr, bytes): + msg = b'pathsuboption take `str` as "attr" argument, not `bytes`' + util.nouideprecwarn(msg, b"6.6", stacklevel=2) + attr = attr.decode('ascii') def register(func): _pathsuboptions[option] = (attr, func)