Submitter | Augie Fackler |
---|---|
Date | Oct. 9, 2016, 2:16 p.m. |
Message ID | <2f926a3f2409af24260f.1476022610@augie-macbookair2.roam.corp.google.com> |
Download | mbox | patch |
Permalink | /patch/17005/ |
State | Accepted |
Headers | show |
Comments
On Sun, 09 Oct 2016 10:16:50 -0400, Augie Fackler wrote: > # HG changeset patch > # User Augie Fackler <augie@google.com> > # Date 1476019069 14400 > # Sun Oct 09 09:17:49 2016 -0400 > # Node ID 2f926a3f2409af24260f826ca1823c564ffea03e > # Parent f2359d649c2164ba5efb3c202850064c7d777848 > ui: explicitly open config files in binary mode > > This has been working mostly accidentally, but now it works explicitly. > > diff --git a/mercurial/ui.py b/mercurial/ui.py > --- a/mercurial/ui.py > +++ b/mercurial/ui.py > @@ -176,7 +176,7 @@ class ui(object): > def readconfig(self, filename, root=None, trust=False, > sections=None, remap=None): > try: > - fp = open(filename) > + fp = open(filename, u'rb') Do we still need this after 1f01e3e33336 "py3: a second argument to open can't be bytes" ?
On 10 October 2016 at 21:47, Yuya Nishihara <yuya@tcha.org> wrote: > Do we still need this after 1f01e3e33336 "py3: a second argument to open > can't be bytes" ? > I don't think so, no, but I haven't explicitly tested this line.
> On Oct 11, 2016, at 8:59 AM, Martijn Pieters <mj@zopatista.com> wrote: > > > On 10 October 2016 at 21:47, Yuya Nishihara <yuya@tcha.org> wrote: > Do we still need this after 1f01e3e33336 "py3: a second argument to open > can't be bytes" ? > > I don't think so, no, but I haven't explicitly tested this line. No, this patch isn’t needed anymore. > > -- > Martijn Pieters
Patch
diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -176,7 +176,7 @@ class ui(object): def readconfig(self, filename, root=None, trust=False, sections=None, remap=None): try: - fp = open(filename) + fp = open(filename, u'rb') except IOError: if not sections: # ignore unless we were looking for something return