[PATCH 5 of 5] check-code: handle py3 open divergence

timeless timeless at gmail.com
Sun May 15 10:33:26 EDT 2016


I don't know. I'm trying to take baby steps. If I or someone else hit a
problem with only ASCII, we can address it then.
On May 15, 2016 3:44 AM, "Yuya Nishihara" <yuya at tcha.org> wrote:

> On Wed, 11 May 2016 04:12:50 +0000, timeless wrote:
> > # HG changeset patch
> > # User timeless <timeless at mozdev.org>
> > # Date 1462931171 0
> > #      Wed May 11 01:46:11 2016 +0000
> > # Node ID c5dfd864d81f5d1f435ff376ea44b3ea82b12575
> > # Parent  ed2dbfec165a0de79c93d7fa1ea9cb5f36b10c29
> > # EXP-Topic runtests
> > # Available At bb://timeless/mercurial-crew
> > #              hg pull bb://timeless/mercurial-crew -r c5dfd864d81f
> > check-code: handle py3 open divergence
> >
> > open() really wants an encoding attribute
> >
> > diff -r ed2dbfec165a -r c5dfd864d81f contrib/check-code.py
> > --- a/contrib/check-code.py   Wed May 11 01:44:39 2016 +0000
> > +++ b/contrib/check-code.py   Wed May 11 01:46:11 2016 +0000
> > @@ -26,6 +26,11 @@
> >  import os
> >  import re
> >  import sys
> > +if sys.version_info[0] < 3:
> > +    opentext = open
> > +else:
> > +    def opentext(f):
> > +        return open(f, encoding='ascii')
>
> Do we want a unicode on Python3 ?
>
> I'm not saying we shouldn't, I just wondered. That would be manageable to
> use unicodes in small scripts like check-code.py.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160515/24f471ae/attachment.html>


More information about the Mercurial-devel mailing list