diff -r 34eb3a711955 -r 4eccb65e444f mercurial/utils/stringutil.py --- a/mercurial/utils/stringutil.py Sun Jun 30 16:02:50 2024 +0200 +++ b/mercurial/utils/stringutil.py Wed Aug 28 23:25:26 2024 +0200 @@ -724,7 +724,7 @@ def escapestr(s: bytes) -> bytes: # "bytes" is also a typing shortcut for bytes, bytearray, and memoryview - if isinstance(s, memoryview): + if isinstance(s, (memoryview, bytearray)): s = bytes(s) # call underlying function of s.encode('string_escape') directly for # Python 3 compatibility