diff --git a/hgext/remotefilelog/shallowbundle.py b/hgext/remotefilelog/shallowbundle.py --- a/hgext/remotefilelog/shallowbundle.py +++ b/hgext/remotefilelog/shallowbundle.py @@ -269,8 +269,8 @@ base = fl.revision(deltabase, raw=True) text = mdiff.patch(base, delta) - if isinstance(text, buffer): - text = str(text) + if not isinstance(text, bytes): + text = bytes(text) meta, text = shallowutil.parsemeta(text) if 'copy' in meta: