Patchwork D12568: git: un-byteify the `mode` argument for the builtin `open()`

login
register
mail settings
Submitter phabricator
Date April 18, 2022, 6:54 p.m.
Message ID <differential-rev-PHID-DREV-sncfh2g4yzloncvqlxzq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50916/
State New
Headers show

Comments

phabricator - April 18, 2022, 6:54 p.m.
mharbison72 created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I guess this was assuming `pycompat.open` was imported, but it's not here or
  elsewhere in the git extension.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/git/dirstate.py

CHANGE DETAILS




To: mharbison72, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/hgext/git/dirstate.py b/hgext/git/dirstate.py
--- a/hgext/git/dirstate.py
+++ b/hgext/git/dirstate.py
@@ -33,7 +33,7 @@ 
         return orig(filepath, warn, sourceinfo=False)
     result = []
     warnings = []
-    with open(filepath, b'rb') as fp:
+    with open(filepath, 'rb') as fp:
         for l in fp:
             l = l.strip()
             if not l or l.startswith(b'#'):