# HG changeset patch # User Gregory Szorc # Date 1518387507 28800 # Node ID a5cf79755eff37cb70d24a24a35a18c8866fb385 # Parent 04984f2e50ae53840f8628ca203f03000f4de222 py3: open temporary file in binary mode Otherwise things fail later when we write bytes to the handle. Differential Revision: https://phab.mercurial-scm.org/D2148 diff -r 04984f2e50ae -r a5cf79755eff mercurial/patch.py --- a/mercurial/patch.py Sun Feb 11 14:17:23 2018 -0800 +++ b/mercurial/patch.py Sun Feb 11 14:18:27 2018 -0800 @@ -215,7 +215,7 @@ data = {} fd, tmpname = tempfile.mkstemp(prefix='hg-patch-') - tmpfp = os.fdopen(fd, pycompat.sysstr('w')) + tmpfp = os.fdopen(fd, pycompat.sysstr('wb')) try: msg = pycompat.emailparser().parse(fileobj)