Quoting Jan Vesely (2016-03-29 21:24:28) > On Fri, 2016-03-25 at 14:28 -0700, Dylan Baker wrote: > > In python 3.x input is unicode by default, but in python 2.x > > everything > > is a byte string by default, this includes input. Currently when > > running > > with python 3.x it's possible to use unicode for input, but python > > 2.x > > will choke when it tries to encode the bytes into unicode using the > > ascii codec. > > > > For example, this will work with python 3.x but no with python 2.x: > > (The character is yuki, Japanese for snow, if memory serves) > > ./piglit run quick 雪 -c > > > > This is actually pretty easy to fix, when runnging with python 2.x > > decode each input element into unicode using utf-8 as soon as the > > input > > is received. > > > > Signed-off-by: Dylan Baker <[email protected]> > > This breaks all partial commands with python3. only ./piglit checks > python version, the rest try to do decode unconditionally. Is this > intended? > > > $ python3 ./piglit-print-commands.py tests/cl.py > Traceback (most recent call last): > File "./piglit-print-commands.py", line 89, in <module> > main() > File "./piglit-print-commands.py", line 41, in main > input_ = [i.decode('utf-8') for i in sys.argv[1:]] > File "./piglit-print-commands.py", line 41, in <listcomp> > input_ = [i.decode('utf-8') for i in sys.argv[1:]] > AttributeError: 'str' object has no attribute 'decode' > > Jan >
Uh, we should probably check for python2 there too. I actually didn't realize that print-commands even worked with python3. I can send out a patch.
signature.asc
Description: signature
_______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
