# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1526735840 -19800 # Node ID 1978abdb216c1c6e00cf9cc43e7ce59557636e15 # Parent 8fa2b5c85a46714d4cdc2ef93929735882e98cc6 py3: make sure we open files in bytes mode we internally deal with bytes and should read files in bytes mode. Differential Revision: https://phab.mercurial-scm.org/D3606 diff -r 8fa2b5c85a46 -r 1978abdb216c hgext/churn.py --- a/hgext/churn.py Sat May 19 18:45:53 2018 +0530 +++ b/hgext/churn.py Sat May 19 18:47:20 2018 +0530 @@ -161,7 +161,7 @@ if not aliases and os.path.exists(repo.wjoin('.hgchurn')): aliases = repo.wjoin('.hgchurn') if aliases: - for l in open(aliases, "r"): + for l in open(aliases, "rb"): try: alias, actual = l.rsplit('=' in l and '=' or None, 1) amap[alias.strip()] = actual.strip() diff -r 8fa2b5c85a46 -r 1978abdb216c mercurial/crecord.py --- a/mercurial/crecord.py Sat May 19 18:45:53 2018 +0530 +++ b/mercurial/crecord.py Sat May 19 18:47:20 2018 +0530 @@ -554,7 +554,7 @@ """ chunkselector = curseschunkselector(headerlist, ui, operation) if testfn and os.path.exists(testfn): - testf = open(testfn) + testf = open(testfn, 'rb') testcommands = [x.rstrip('\n') for x in testf.readlines()] testf.close() while True: