Patchwork D3274: py3: make sure we open file in bytes mode

login
register
mail settings
Submitter phabricator
Date April 12, 2018, 12:05 p.m.
Message ID <differential-rev-PHID-DREV-f5pvloehwe7pjc4h6bd6-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30773/
State Superseded
Headers show

Comments

phabricator - April 12, 2018, 12:05 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/sparse.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/sparse.py b/mercurial/sparse.py
--- a/mercurial/sparse.py
+++ b/mercurial/sparse.py
@@ -579,7 +579,7 @@ 
         # part of the active rules.
         changed = False
         for p in paths:
-            with util.posixfile(util.expandpath(p)) as fh:
+            with util.posixfile(util.expandpath(p), mode='rb') as fh:
                 raw = fh.read()
 
             iincludes, iexcludes, iprofiles = parseconfig(repo.ui, raw)