Patchwork [3,of,4,v2] run-tests: add support for RTUNICODEPEDANTRY environment variable

login
register
mail settings
Submitter timeless
Date May 11, 2016, 5:51 p.m.
Message ID <ac615a1325bf2d0a2d8c.1462989086@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/15029/
State Accepted
Delegated to: Augie Fackler
Headers show

Comments

timeless - May 11, 2016, 5:51 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459820158 0
#      Tue Apr 05 01:35:58 2016 +0000
# Node ID ac615a1325bf2d0a2d8c87ae32e755c5d6f56e52
# Parent  ed9fa9c2af2c37a9273d1f20c96f4acb45733fe6
# EXP-Topic runtests
# Available At bb://timeless/mercurial-crew
#              hg pull bb://timeless/mercurial-crew -r ac615a1325bf
run-tests: add support for RTUNICODEPEDANTRY environment variable

based on 73e4a02e6d23
Yuya Nishihara - May 20, 2016, 2:06 p.m.
On Wed, 11 May 2016 17:51:26 +0000, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1459820158 0
> #      Tue Apr 05 01:35:58 2016 +0000
> # Node ID ac615a1325bf2d0a2d8c87ae32e755c5d6f56e52
> # Parent  ed9fa9c2af2c37a9273d1f20c96f4acb45733fe6
> # EXP-Topic runtests
> # Available At bb://timeless/mercurial-crew
> #              hg pull bb://timeless/mercurial-crew -r ac615a1325bf
> run-tests: add support for RTUNICODEPEDANTRY environment variable
> 
> based on 73e4a02e6d23
> 
> diff -r ed9fa9c2af2c -r ac615a1325bf tests/run-tests.py
> --- a/tests/run-tests.py	Tue May 10 22:52:26 2016 +0000
> +++ b/tests/run-tests.py	Tue Apr 05 01:35:58 2016 +0000
> @@ -69,6 +69,13 @@
>  from xml.dom import minidom
>  import unittest
>  
> +if os.environ.get('RTUNICODEPEDANTRY', False):
> +    try:
> +        reload(sys)
> +        sys.setdefaultencoding("undefined")
> +    except NameError:
> +        pass

The code looks good, but "RT" sounds a bit odd to me. I wanna ask someone
to decide to take this or not.
Sean Farley - May 20, 2016, 7:43 p.m.
Yuya Nishihara <yuya@tcha.org> writes:

> On Wed, 11 May 2016 17:51:26 +0000, timeless wrote:
>> # HG changeset patch
>> # User timeless <timeless@mozdev.org>
>> # Date 1459820158 0
>> #      Tue Apr 05 01:35:58 2016 +0000
>> # Node ID ac615a1325bf2d0a2d8c87ae32e755c5d6f56e52
>> # Parent  ed9fa9c2af2c37a9273d1f20c96f4acb45733fe6
>> # EXP-Topic runtests
>> # Available At bb://timeless/mercurial-crew
>> #              hg pull bb://timeless/mercurial-crew -r ac615a1325bf
>> run-tests: add support for RTUNICODEPEDANTRY environment variable
>> 
>> based on 73e4a02e6d23
>> 
>> diff -r ed9fa9c2af2c -r ac615a1325bf tests/run-tests.py
>> --- a/tests/run-tests.py	Tue May 10 22:52:26 2016 +0000
>> +++ b/tests/run-tests.py	Tue Apr 05 01:35:58 2016 +0000
>> @@ -69,6 +69,13 @@
>>  from xml.dom import minidom
>>  import unittest
>>  
>> +if os.environ.get('RTUNICODEPEDANTRY', False):
>> +    try:
>> +        reload(sys)
>> +        sys.setdefaultencoding("undefined")
>> +    except NameError:
>> +        pass
>
> The code looks good, but "RT" sounds a bit odd to me. I wanna ask someone
> to decide to take this or not.

Yeah, I agree that RT sounds odd to me, too.
Augie Fackler - May 23, 2016, 7:18 p.m.
On Fri, May 20, 2016 at 02:43:36PM -0500, Sean Farley wrote:
>
> Yuya Nishihara <yuya@tcha.org> writes:
>
> > On Wed, 11 May 2016 17:51:26 +0000, timeless wrote:
> >> # HG changeset patch
> >> # User timeless <timeless@mozdev.org>
> >> # Date 1459820158 0
> >> #      Tue Apr 05 01:35:58 2016 +0000
> >> # Node ID ac615a1325bf2d0a2d8c87ae32e755c5d6f56e52
> >> # Parent  ed9fa9c2af2c37a9273d1f20c96f4acb45733fe6
> >> # EXP-Topic runtests
> >> # Available At bb://timeless/mercurial-crew
> >> #              hg pull bb://timeless/mercurial-crew -r ac615a1325bf
> >> run-tests: add support for RTUNICODEPEDANTRY environment variable
> >>
> >> based on 73e4a02e6d23
> >>
> >> diff -r ed9fa9c2af2c -r ac615a1325bf tests/run-tests.py
> >> --- a/tests/run-tests.py	Tue May 10 22:52:26 2016 +0000
> >> +++ b/tests/run-tests.py	Tue Apr 05 01:35:58 2016 +0000
> >> @@ -69,6 +69,13 @@
> >>  from xml.dom import minidom
> >>  import unittest
> >>
> >> +if os.environ.get('RTUNICODEPEDANTRY', False):
> >> +    try:
> >> +        reload(sys)
> >> +        sys.setdefaultencoding("undefined")
> >> +    except NameError:
> >> +        pass
> >
> > The code looks good, but "RT" sounds a bit odd to me. I wanna ask someone
> > to decide to take this or not.
>
> Yeah, I agree that RT sounds odd to me, too.

I'm guessing here, but I suspect the reason is to allow testing
unicode pedant mode on run-tests without having that matter for the hg
under test. timeless, is that right?

Note that I'd be a bigger fan of just always running run-tests in
unicode pedant mode. Is that not possible for some reason?

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
timeless - May 24, 2016, 3:23 a.m.
Augie Fackler wrote:
> I'm guessing here, but I suspect the reason is to allow testing
> unicode pedant mode on run-tests without having that matter for the hg
> under test. timeless, is that right?

yes.

> Note that I'd be a bigger fan of just always running run-tests in
> unicode pedant mode. Is that not possible for some reason?

it isn't even close to ready. I have a sizeable series to try to get
that working.

Yes, once it works, I'd prefer to make it mandatory, but until then...
Augie Fackler - May 24, 2016, 3:20 p.m.
On Mon, May 23, 2016 at 08:23:27PM -0700, timeless wrote:
> Augie Fackler wrote:
> > I'm guessing here, but I suspect the reason is to allow testing
> > unicode pedant mode on run-tests without having that matter for the hg
> > under test. timeless, is that right?
>
> yes.
>
> > Note that I'd be a bigger fan of just always running run-tests in
> > unicode pedant mode. Is that not possible for some reason?
>
> it isn't even close to ready. I have a sizeable series to try to get
> that working.
>
> Yes, once it works, I'd prefer to make it mandatory, but until then...

Can you point me to that series as a URL? I'd like to get an idea of
where this is going. I'm not sure how I feel about the variable yet,
but seeing the rest of the work involved would help.

Thanks!
timeless - May 24, 2016, 3:31 p.m.
Augie Fackler wrote:
> Can you point me to that series as a URL? I'd like to get an idea of
> where this is going. I'm not sure how I feel about the variable yet,
> but seeing the rest of the work involved would help.

https://bitbucket.org/timeless/mercurial-crew/commits/all?search=%3A%3Ab1273033cbe8

i'm not terribly attached to _asbytes over _bytespath
but _bytespath is inaccurate when talking about environment and args
and a few other things

Patch

diff -r ed9fa9c2af2c -r ac615a1325bf tests/run-tests.py
--- a/tests/run-tests.py	Tue May 10 22:52:26 2016 +0000
+++ b/tests/run-tests.py	Tue Apr 05 01:35:58 2016 +0000
@@ -69,6 +69,13 @@ 
 from xml.dom import minidom
 import unittest
 
+if os.environ.get('RTUNICODEPEDANTRY', False):
+    try:
+        reload(sys)
+        sys.setdefaultencoding("undefined")
+    except NameError:
+        pass
+
 osenvironb = getattr(os, 'environb', os.environ)
 processlock = threading.Lock()