# HG changeset patch # User Augie Fackler # Date 2018-03-01 22:46:34 # Node ID 63fe5ca93b1313582dd61e71c689cf2be90556f1 # Parent c28de190e20ab1c6b93a33ee0c6627f7e5030ca5 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 diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -224,8 +224,8 @@ if ispy3: 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): """