[apparmor] [patch] Adjust test-aa.py for python2

Christian Boltz apparmor at cboltz.de
Thu Dec 17 22:02:59 UTC 2015


Hello,

Am Donnerstag, 17. Dezember 2015 schrieb Tyler Hicks:
> On 2015-11-29 22:34:43, Christian Boltz wrote:

> > -        ('#!/bin/bash\ntrue',      ('/bin/bash',           
> > 'abstractions/bash')), 
> > +        ('#!/bin/bash\ntrue',     
> > (u'/bin/bash',           'abstractions/bash')),
> This syntax for unicode strings was introduced for Python 3 in version
> 3.3:
> 
>   https://www.python.org/dev/peps/pep-0414/
> 
> That means that this change will prevent the test from being run on
> python3.2 in Ubuntu 12.04:

Does 12.04 have AppArmor 2.10 or newer? I slightly doubt.

>   $ python3.2 -c "print(u'test')"
>     File "<string>", line 1
>       print(u'test')
>                   ^
>     SyntaxError: invalid syntax
> 
> That may affect Steve's automated tests so I'm cc'ing him so that he
> can NAK, if needed.

The problem is (IIRC) that the u'...' is needed to let the tests succeed 
with py2, and that's worth more IMHO.

The good news is: I also have a solution for this problem:

# grep Python README | tail -n1
The Python utilities require a minimum of Python 2.7 or Python 3.3.

*eg*

> If he's good with the change, then...
> 
>   Acked-by: Tyler Hicks <tyhicks at canonical.com>
> 
> ... for both branches.

Given how responsive/busy Steve is currently, I'll just commit with your 
Ack before he can object ;-)


Regards,

Christian Boltz
-- 
dU hAsT nAtUeRlIcH rEcHt. MaN mUsS sIcH bEiM lEsEn NuR dArAn GeWoEhNeN.
mAcHt DaNn KeInEn UnTeRsChIeD mEhR.       [Andreas Kneib in suse-linux]




More information about the AppArmor mailing list