--- a/hgext/mq.py Mon Feb 05 13:12:01 2018 +0530+++ b/hgext/mq.py Mon Feb 05 13:12:36 2018 +0530@@ -281,7 +281,7 @@ nodeid = None diffstart = 0- for line in file(pf):+ for line in open(pf, 'rb'): line = line.rstrip() if (line.startswith('diff --git') or (diffstart and line.startswith('+++ '))):