Patchwork D7544: py3: remove incorrect b prefix on second argument to open in subrepo.py

login
register
mail settings
Submitter phabricator
Date Dec. 4, 2019, 1:36 a.m.
Message ID <differential-rev-PHID-DREV-s4qs72qo2bhbadj4jyel-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43578/
State Superseded
Headers show

Comments

phabricator - Dec. 4, 2019, 1:36 a.m.
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/subrepo.py

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-devel
phabricator - Dec. 4, 2019, 4:51 a.m.
mharbison72 added a comment.


  I don't think this is correct, because `open` is imported from `pycompat` at the top of the file, and that will `sysstr()` the mode.  But this does seem confusing- see D7517 <https://phab.mercurial-scm.org/D7517>.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7544/new/

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

To: spectral, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - Dec. 4, 2019, 6:21 a.m.
spectral added a comment.


  In D7544#110954 <https://phab.mercurial-scm.org/D7544#110954>, @mharbison72 wrote:
  
  > I don't think this is correct, because `open` is imported from `pycompat` at the top of the file, and that will `sysstr()` the mode.  But this does seem confusing- see D7517 <https://phab.mercurial-scm.org/D7517>.
  
  Ah, so it is. Since this is the only use of open in this file, I've switched to just using `pycompat.open` directly in this location.  I'm also fine with just dropping this change.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7544/new/

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

To: spectral, #hg-reviewers
Cc: mharbison72, mercurial-devel

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1434,7 +1434,7 @@ 
         # which is mostly progress and useful info
         errpipe = None
         if self.ui.quiet:
-            errpipe = open(os.devnull, b'w')
+            errpipe = open(os.devnull, 'w')
         if self.ui._colormode and len(commands) and commands[0] == b"diff":
             # insert the argument in the front,
             # the end of git diff arguments is used for paths