Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ValueError
- Python 3.6.0: /usr/bin/python
- Fri Feb 3 23:28:47 2017
- A problem occurred in a Python script. Here is the sequence of
- function calls leading up to the error, in the order they occurred.
- /usr/bin/aa-genprof in <module>()
- 143
- 144 q = aaui.PromptQuestion()
- 145 q.headers = [_('Profiling'), program]
- 146 q.functions = ['CMD_SCAN', 'CMD_FINISHED']
- 147 q.default = 'CMD_SCAN'
- 148 ans, arg = q.promptUser('noexit')
- 149
- 150 if ans == 'CMD_SCAN':
- 151 lp_ret = apparmor.do_logprof_pass(logmark, passno)
- 152 passno += 1
- ans undefined
- arg undefined
- q = <apparmor.ui.PromptQuestion object>
- q.promptUser = <bound method PromptQuestion.promptUser of <apparmor.ui.PromptQuestion object>>
- /usr/lib/python3.6/site-packages/apparmor/ui.py in promptUser(self=<apparmor.ui.PromptQuestion object>, params='noexit')
- 299
- 300 def promptUser(self, params=''):
- 301 cmd = None
- 302 arg = None
- 303 if UI_mode == 'text':
- 304 cmd, arg = self.Text_PromptUser()
- 305 else:
- 306 self.type = 'wizard'
- 307 SendDataToYast(self)
- 308 ypath, yarg = GetDataFromYast()
- cmd = None
- arg = None
- self = <apparmor.ui.PromptQuestion object>
- self.Text_PromptUser = <bound method PromptQuestion.Text_PromptUser of <apparmor.ui.PromptQuestion object>>
- /usr/lib/python3.6/site-packages/apparmor/ui.py in Text_PromptUser(self=<apparmor.ui.PromptQuestion object>)
- 335 if not CMDS.get(cmd, False):
- 336 raise AppArmorException(_('PromptUser: Unknown command %s') % cmd)
- 337
- 338 menutext = CMDS[cmd]
- 339
- 340 key = get_translated_hotkey(menutext).lower()
- 341 # Duplicate hotkey
- 342 if keys.get(key, False):
- 343 raise AppArmorException(_('PromptUser: Duplicate hotkey for %(command)s: %(menutext)s ') % { 'command': cmd, 'menutext': menutext })
- 344
- key undefined
- global get_translated_hotkey = <function get_translated_hotkey>
- menutext = '(S)can system log for AppArmor events'
- ).lower = <built-in method lower of str object>
- /usr/lib/python3.6/site-packages/apparmor/ui.py in get_translated_hotkey(translated='(S)can system log for AppArmor events', cmsg='')
- 62
- 63 def get_translated_hotkey(translated, cmsg=''):
- 64 msg = 'PromptUser: ' + _('Invalid hotkey for')
- 65
- 66 # Originally (\S) was used but with translations it would not work :(
- 67 if re.search('\((\S+)\)', translated, re.LOCALE):
- 68 return re.search('\((\S+)\)', translated, re.LOCALE).groups()[0]
- 69 else:
- 70 if cmsg:
- 71 raise AppArmorException(cmsg)
- global re = <module 're' from '/usr/lib/python3.6/re.py'>
- re.search = <function search>
- translated = '(S)can system log for AppArmor events'
- re.LOCALE = <RegexFlag.LOCALE: 4>
- /usr/lib/python3.6/re.py in search(pattern=r'\((\S+)\)', string='(S)can system log for AppArmor events', flags=<RegexFlag.LOCALE: 4>)
- 177 return _compile(pattern, flags).fullmatch(string)
- 178
- 179 def search(pattern, string, flags=0):
- 180 """Scan through string looking for a match to the pattern, returning
- 181 a match object, or None if no match was found."""
- 182 return _compile(pattern, flags).search(string)
- 183
- 184 def sub(pattern, repl, string, count=0, flags=0):
- 185 """Return the string obtained by replacing the leftmost
- 186 non-overlapping occurrences of the pattern in string by the
- global _compile = <function _compile>
- pattern = r'\((\S+)\)'
- flags = <RegexFlag.LOCALE: 4>
- ).search undefined
- string = '(S)can system log for AppArmor events'
- /usr/lib/python3.6/re.py in _compile(pattern=r'\((\S+)\)', flags=<RegexFlag.LOCALE: 4>)
- 296 raise ValueError(
- 297 "cannot process flags argument with a compiled pattern")
- 298 return pattern
- 299 if not sre_compile.isstring(pattern):
- 300 raise TypeError("first argument must be string or compiled pattern")
- 301 p = sre_compile.compile(pattern, flags)
- 302 if not (flags & DEBUG):
- 303 if len(_cache) >= _MAXCACHE:
- 304 _cache.clear()
- 305 if p.flags & LOCALE:
- p undefined
- global sre_compile = <module 'sre_compile' from '/usr/lib/python3.6/sre_compile.py'>
- sre_compile.compile = <function compile>
- pattern = r'\((\S+)\)'
- flags = <RegexFlag.LOCALE: 4>
- /usr/lib/python3.6/sre_compile.py in compile(p=r'\((\S+)\)', flags=<RegexFlag.LOCALE: 4>)
- 557 def compile(p, flags=0):
- 558 # internal: convert pattern list to internal format
- 559
- 560 if isstring(p):
- 561 pattern = p
- 562 p = sre_parse.parse(p, flags)
- 563 else:
- 564 pattern = None
- 565
- 566 code = _code(p, flags)
- p = r'\((\S+)\)'
- global sre_parse = <module 'sre_parse' from '/usr/lib/python3.6/sre_parse.py'>
- sre_parse.parse = <function parse>
- flags = <RegexFlag.LOCALE: 4>
- /usr/lib/python3.6/sre_parse.py in parse(str=r'\((\S+)\)', flags=<RegexFlag.LOCALE: 4>, pattern=<sre_parse.Pattern object>)
- 861 pattern.flags = flags | SRE_FLAG_VERBOSE
- 862 pattern.str = str
- 863 source.seek(0)
- 864 p = _parse_sub(source, pattern, True, False)
- 865
- 866 p.pattern.flags = fix_flags(str, p.pattern.flags)
- 867
- 868 if source.next is not None:
- 869 assert source.next == ")"
- 870 raise source.error("unbalanced parenthesis")
- p = [(LITERAL, 40), (SUBPATTERN, (1, 0, 0, [(MAX_REP...GORY, CATEGORY_NOT_SPACE)])]))])), (LITERAL, 41)]
- p.pattern = <sre_parse.Pattern object>
- p.pattern.flags = <RegexFlag.LOCALE: 4>
- global fix_flags = <function fix_flags>
- str = r'\((\S+)\)'
- /usr/lib/python3.6/sre_parse.py in fix_flags(src=r'\((\S+)\)', flags=<RegexFlag.LOCALE: 4>)
- 828
- 829 def fix_flags(src, flags):
- 830 # Check and fix flags according to the type of pattern (str or bytes)
- 831 if isinstance(src, str):
- 832 if flags & SRE_FLAG_LOCALE:
- 833 raise ValueError("cannot use LOCALE flag with a str pattern")
- 834 if not flags & SRE_FLAG_ASCII:
- 835 flags |= SRE_FLAG_UNICODE
- 836 elif flags & SRE_FLAG_UNICODE:
- 837 raise ValueError("ASCII and UNICODE flags are incompatible")
- builtinValueError = <class 'ValueError'>
- ValueError: cannot use LOCALE flag with a str pattern
- __cause__ = None
- __class__ = <class 'ValueError'>
- __context__ = None
- __delattr__ = <method-wrapper '__delattr__' of ValueError object>
- __dict__ = {}
- __dir__ = <built-in method __dir__ of ValueError object>
- __doc__ = 'Inappropriate argument value (of correct type).'
- __eq__ = <method-wrapper '__eq__' of ValueError object>
- __format__ = <built-in method __format__ of ValueError object>
- __ge__ = <method-wrapper '__ge__' of ValueError object>
- __getattribute__ = <method-wrapper '__getattribute__' of ValueError object>
- __gt__ = <method-wrapper '__gt__' of ValueError object>
- __hash__ = <method-wrapper '__hash__' of ValueError object>
- __init__ = <method-wrapper '__init__' of ValueError object>
- __init_subclass__ = <built-in method __init_subclass__ of type object>
- __le__ = <method-wrapper '__le__' of ValueError object>
- __lt__ = <method-wrapper '__lt__' of ValueError object>
- __ne__ = <method-wrapper '__ne__' of ValueError object>
- __new__ = <built-in method __new__ of type object>
- __reduce__ = <built-in method __reduce__ of ValueError object>
- __reduce_ex__ = <built-in method __reduce_ex__ of ValueError object>
- __repr__ = <method-wrapper '__repr__' of ValueError object>
- __setattr__ = <method-wrapper '__setattr__' of ValueError object>
- __setstate__ = <built-in method __setstate__ of ValueError object>
- __sizeof__ = <built-in method __sizeof__ of ValueError object>
- __str__ = <method-wrapper '__str__' of ValueError object>
- __subclasshook__ = <built-in method __subclasshook__ of type object>
- __suppress_context__ = False
- __traceback__ = <traceback object>
- args = ('cannot use LOCALE flag with a str pattern',)
- with_traceback = <built-in method with_traceback of ValueError object>
- The above is a description of an error in a Python program. Here is
- the original traceback:
- Traceback (most recent call last):
- File "/usr/bin/aa-genprof", line 148, in <module>
- ans, arg = q.promptUser('noexit')
- File "/usr/lib/python3.6/site-packages/apparmor/ui.py", line 304, in promptUser
- cmd, arg = self.Text_PromptUser()
- File "/usr/lib/python3.6/site-packages/apparmor/ui.py", line 340, in Text_PromptUser
- key = get_translated_hotkey(menutext).lower()
- File "/usr/lib/python3.6/site-packages/apparmor/ui.py", line 67, in get_translated_hotkey
- if re.search('\((\S+)\)', translated, re.LOCALE):
- File "/usr/lib/python3.6/re.py", line 182, in search
- return _compile(pattern, flags).search(string)
- File "/usr/lib/python3.6/re.py", line 301, in _compile
- p = sre_compile.compile(pattern, flags)
- File "/usr/lib/python3.6/sre_compile.py", line 562, in compile
- p = sre_parse.parse(p, flags)
- File "/usr/lib/python3.6/sre_parse.py", line 866, in parse
- p.pattern.flags = fix_flags(str, p.pattern.flags)
- File "/usr/lib/python3.6/sre_parse.py", line 833, in fix_flags
- raise ValueError("cannot use LOCALE flag with a str pattern")
- ValueError: cannot use LOCALE flag with a str pattern
- Please consider reporting a bug at https://bugs.launchpad.net/apparmor/
- and attach this file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement