Patchwork D2148: py3: open temporary file in binary mode

login
register
mail settings
Submitter phabricator
Date Feb. 12, 2018, 1:40 a.m.
Message ID <db3d23b79450db0965c86c54774983a0@localhost.localdomain>
Download mbox | patch
Permalink /patch/27617/
State Not Applicable
Headers show

Comments

phabricator - Feb. 12, 2018, 1:40 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa5cf79755eff: py3: open temporary file in binary mode (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2148?vs=5433&id=5449

REVISION DETAIL
  https://phab.mercurial-scm.org/D2148

AFFECTED FILES
  mercurial/patch.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -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)