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

Tyler Hicks tyhicks at canonical.com
Thu Dec 17 22:43:57 UTC 2015


On 2015-12-17 23:02:59, Christian Boltz wrote:
> 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.

No but we have a daily build PPA that builds trunk on all stable Ubuntu
releases. I think he uses those builds for kicking off automated tests.

Checking out the daily build PPA, I see that trunk no longer builds on
12.04:

  https://code.launchpad.net/~apparmor-dev/+archive/ubuntu/apparmor-daily-trunk/+packages

So, I think that's your green light to commit this patch.

Tyler

> 
> >   $ 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]
> 
> 
> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20151217/fa5afaab/attachment.pgp>


More information about the AppArmor mailing list