pycompat: add support for encoding argument to our wrapper
authorAugie Fackler <augie@google.com>
Thu, 01 Mar 2018 17:46:34 -0500
changeset 36556 63fe5ca93b13
parent 36555 c28de190e20a
child 36557 d60430dc7853
pycompat: add support for encoding argument to our wrapper This only works on Python 3, but I'm about to need it for a regrettable hack in the convert code. Differential Revision: https://phab.mercurial-scm.org/D2524
mercurial/pycompat.py
--- a/mercurial/pycompat.py	Fri Mar 02 04:49:08 2018 +0530
+++ b/mercurial/pycompat.py	Thu Mar 01 17:46:34 2018 -0500
@@ -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):
         """