[PATCH 1 of 6] py3: decode bytes before logging in run-tests.py

Augie Fackler raf at durin42.com
Mon Oct 21 15:57:17 EDT 2019


On Mon, Oct 21, 2019 at 10:40:24PM +0900, Yuya Nishihara wrote:
> On Mon, 21 Oct 2019 12:00:53 +0200, Denis Laxalde wrote:
> > # HG changeset patch
> > # User Denis Laxalde <denis at laxalde.org>
> > # Date 1571650001 -7200
> > #      Mon Oct 21 11:26:41 2019 +0200
> > # Node ID f6d36e1d008ac5eaaccfaeb2a598cdbdf1d36391
> > # Parent  d0f89e8c615aca23f169c228a86f4f77fa4dbb67
> > py3: decode bytes before logging in run-tests.py
>
> > @@ -3111,12 +3111,16 @@ class TestRunner(object):
> >                  'extensions.logexceptions=%s' % logexceptions.decode('utf-8')
> >              )
> >
> > -        vlog("# Using TESTDIR", self._testdir)
> > -        vlog("# Using RUNTESTDIR", osenvironb[b'RUNTESTDIR'])
> > -        vlog("# Using HGTMP", self._hgtmp)
> > +        vlog("# Using TESTDIR", self._testdir.decode("utf-8"))
> > +        vlog("# Using RUNTESTDIR", osenvironb[b'RUNTESTDIR'].decode("utf-8"))
> > +        vlog("# Using HGTMP", self._hgtmp.decode("utf-8"))
> >          vlog("# Using PATH", os.environ["PATH"])
> > -        vlog("# Using", IMPL_PATH, osenvironb[IMPL_PATH])
> > -        vlog("# Writing to directory", self._outputdir)
> > +        vlog(
> > +            "# Using",
> > +            IMPL_PATH.decode("utf-8"),
> > +            osenvironb[IMPL_PATH].decode("utf-8"),
> > +        )
> > +        vlog("# Writing to directory", self._outputdir.decode("utf-8"))
>
> Maybe better to use _strpath() for paths.

I agree. Denis, can we get a v2 with that changed?

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list