# HG changeset patch # User Anton Shestakov # Date 2023-01-12 15:59:01 # Node ID 9282930f8b52d14acbf1ca4835d30c25beb23363 # Parent 05b329cbd23d789fa77e57faf6b0b4b39ad2e1b7 convert: turn the last str regex into bytes in cvs.py (issue6789) Since root is bytes, the regular expression should also be bytes. diff --git a/hgext/convert/cvs.py b/hgext/convert/cvs.py --- a/hgext/convert/cvs.py +++ b/hgext/convert/cvs.py @@ -142,7 +142,9 @@ class convert_cvs(converter_source): if root.startswith(b":pserver:"): root = root[9:] - m = re.match(r'(?:(.*?)(?::(.*?))?@)?([^:/]*)(?::(\d*))?(.*)', root) + m = re.match( + br'(?:(.*?)(?::(.*?))?@)?([^:/]*)(?::(\d*))?(.*)', root + ) if m: conntype = b"pserver" user, passw, serv, port, root = m.groups()