Mercurial > hg > mercurial-source
diff mercurial/pycompat.py @ 37342:63fe5ca93b13
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
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 01 Mar 2018 17:46:34 -0500 (2018-03-01) |
parents | 4cd2d1cc2a31 |
children | e2b87e19c6ef |
line wrap: on
line diff
--- 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): """