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
--- 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):
"""