AttributeError Python 3.7.3: /usr/bin/python3 Tue Oct 15 18:10:51 2019 A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. /sbin/aa-logprof in () 48 49 if profiledir: 50 apparmor.profile_dir = apparmor.get_full_path(profiledir) 51 if not os.path.isdir(apparmor.profile_dir): 52 raise apparmor.AppArmorException("%s is not a directory."%profiledir) 53 54 apparmor.loadincludes() 55 56 apparmor.do_logprof_pass(logmark) 57 apparmor = apparmor.do_logprof_pass = logmark = '' /usr/lib/python3/dist-packages/apparmor/aa.py in do_logprof_pass(logmark='', passno=0, log_pid={}) 1799 1800 aaui.UI_Info(_('Reading log entries from %s.') % logfile) 1801 1802 if not passno: 1803 aaui.UI_Info(_('Updating AppArmor profiles in %s.') % profile_dir) 1804 read_profiles() 1805 1806 if not sev_db: 1807 sev_db = apparmor.severity.Severity(CONFDIR + '/severity.db', _('unknown')) 1808 #print(pid) global read_profiles = /usr/lib/python3/dist-packages/apparmor/aa.py in read_profiles() 2063 for file in os.listdir(profile_dir): 2064 if os.path.isfile(profile_dir + '/' + file): 2065 if is_skippable_file(file): 2066 continue 2067 else: 2068 read_profile(profile_dir + '/' + file, True) 2069 2070 def read_inactive_profiles(): 2071 if hasattr(read_inactive_profiles, 'already_read'): 2072 # each autodep() run calls read_inactive_profiles, but that's a) superfluous and b) triggers a conflict because the inactive profiles are already loaded global read_profile = global profile_dir = '/etc/apparmor.d' file = 'usr.sbin.cupsd' /usr/lib/python3/dist-packages/apparmor/aa.py in read_profile(file='/etc/apparmor.d/usr.sbin.cupsd', active_profile=True) 2107 for profile in profile_data: # TODO: also honor hats 2108 name = profile_data[profile][profile]['name'] 2109 attachment = profile_data[profile][profile]['attachment'] 2110 filename = profile_data[profile][profile]['filename'] 2111 2112 if not attachment and name.startswith('/'): 2113 active_profiles.add(filename, name, name) # use name as name and attachment 2114 else: 2115 active_profiles.add(filename, name, attachment) 2116 attachment = defaultdict(, {}) name = defaultdict(, {}) name.startswith undefined AttributeError: 'collections.defaultdict' object has no attribute 'startswith' __cause__ = None __class__ = __context__ = None __delattr__ = __dict__ = {} __dir__ = __doc__ = 'Attribute not found.' __eq__ = __format__ = __ge__ = __getattribute__ = __gt__ = __hash__ = __init__ = __init_subclass__ = __le__ = __lt__ = __ne__ = __new__ = __reduce__ = __reduce_ex__ = __repr__ = __setattr__ = __setstate__ = __sizeof__ = __str__ = __subclasshook__ = __suppress_context__ = False __traceback__ = args = ("'collections.defaultdict' object has no attribute 'startswith'",) with_traceback = The above is a description of an error in a Python program. Here is the original traceback: Traceback (most recent call last): File "/sbin/aa-logprof", line 56, in apparmor.do_logprof_pass(logmark) File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 1804, in do_logprof_pass read_profiles() File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 2068, in read_profiles read_profile(profile_dir + '/' + file, True) File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 2112, in read_profile if not attachment and name.startswith('/'): AttributeError: 'collections.defaultdict' object has no attribute 'startswith' Please consider reporting a bug at https://bugs.launchpad.net/apparmor/ and attach this file.