mercurial/util.py
changeset 41384 b141b5243b37
parent 41289 593f6359681d
child 41831 ae189674bdad
--- a/mercurial/util.py	Fri Jan 25 15:36:55 2019 -0800
+++ b/mercurial/util.py	Fri Jan 25 16:00:34 2019 -0800
@@ -789,6 +789,12 @@
                                                       res))
 
         data = dest[0:res] if res is not None else b''
+
+        # _writedata() uses "in" operator and is confused by memoryview because
+        # characters are ints on Python 3.
+        if isinstance(data, memoryview):
+            data = data.tobytes()
+
         self._writedata(data)
 
     def write(self, res, data):