Patchwork D2524: pycompat: add support for encoding argument to our wrapper

login
register
mail settings
Submitter phabricator
Date March 1, 2018, 11:22 p.m.
Message ID <differential-rev-PHID-DREV-trfgjd5hzrsvfnw4axs6-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28616/
State Superseded
Headers show

Comments

phabricator - March 1, 2018, 11:22 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This only works on Python 3, but I'm about to need it for a
  regrettable hack in the convert code.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/pycompat.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -224,8 +224,8 @@ 
     xrange = builtins.range
     unicode = str
 
-    def open(name, mode='r', buffering=-1):
-        return builtins.open(name, sysstr(mode), buffering)
+    def open(name, mode='r', buffering=-1, encoding=None):
+        return builtins.open(name, sysstr(mode), buffering, encoding)
 
     def _getoptbwrapper(orig, args, shortlist, namelist):
         """