Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 599518 - sys-libs/libapparmor-2.10.1-r1 installs an incorrect python2 library
Summary: sys-libs/libapparmor-2.10.1-r1 installs an incorrect python2 library
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michael Palimaka (kensington)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-11 19:23 UTC by fff
Modified: 2017-01-11 16:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fff 2016-11-11 19:23:47 UTC
I am trying learn about apparmor and executing a basic command I get:

# aa-complain /bin/ping
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/aa-complain", line 17, in <module>
    import apparmor.tools
  File "/usr/lib64/python2.7/site-packages/apparmor/tools.py", line 17, in <module>
    import apparmor.aa as apparmor
  File "/usr/lib64/python2.7/site-packages/apparmor/aa.py", line 29, in <module>
    import apparmor.logparser
  File "/usr/lib64/python2.7/site-packages/apparmor/logparser.py", line 19, in <module>
    import LibAppArmor
  File "/usr/lib64/python2.7/site-packages/LibAppArmor/__init__.py", line 1, in <module>
    from LibAppArmor.LibAppArmor import *
ImportError: No module named LibAppArmor

Executing the import from python2 returns the same error, whilst running the import in python3 it works as expected.


searching for this error I found this thread:

http://swig.10945.n7.nabble.com/Problem-with-python-bindings-td14827.html

with this little modification it works again.

--- /usr/lib64/python2.7/site-packages/LibAppArmor/__init__.py.orig       2016-11-11 11:28:33.000000000 +0100
+++ /usr/lib64/python2.7/site-packages/LibAppArmor/__init__.py  2016-11-11 20:06:00.590212917 +0100
@@ -1 +1 @@
-from LibAppArmor.LibAppArmor import *
+from LibAppArmor import *



Reproducible: Always
Comment 1 Michael Palimaka (kensington) gentoo-dev 2017-01-11 16:29:03 UTC
This should be fixed in 2.11.0 now.