[apparmor] [patch] common.py: add debugging, py2 compat fix
Steve Beattie
steve at nxnw.org
Mon Feb 24 19:17:31 UTC 2014
On Mon, Feb 24, 2014 at 07:58:57PM +0100, Christian Boltz wrote:
> Hello,
>
> this patch fixes two (unrelated) issues in common.py:
> - it adds some debug logging in valid_path()
> - it fixes a py2 incompability in DebugLogger.__init__
>
>
> === modified file 'utils/apparmor/common.py'
> --- utils/apparmor/common.py 2014-02-12 23:54:00 +0000
> +++ utils/apparmor/common.py 2014-02-24 18:55:21 +0000
> @@ -112,6 +112,7 @@
> return False
>
> if '"' in path: # We double quote elsewhere
> + debug("%s (contains quote)" % (m))
> return False
>
> try:
> @@ -228,7 +229,7 @@
> try:
> logging.basicConfig(filename=self.logfile, level=self.debug_level,
> format='%(asctime)s - %(name)s - %(message)s\n')
> - except OSError:
> + except IOError:
Does logging in python3 throw an OSError? Perhaps 'except (IOError,
OSError)' which will catch either exception class would be better?
--
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- 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/20140224/65070fcc/attachment.pgp>
More information about the AppArmor
mailing list