Advertisement
Guest User

aa-genprof bug report

a guest
Feb 3rd, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.54 KB | None | 0 0
  1. ValueError
  2. Python 3.6.0: /usr/bin/python
  3. Fri Feb 3 23:28:47 2017
  4.  
  5. A problem occurred in a Python script. Here is the sequence of
  6. function calls leading up to the error, in the order they occurred.
  7.  
  8. /usr/bin/aa-genprof in <module>()
  9. 143
  10. 144 q = aaui.PromptQuestion()
  11. 145 q.headers = [_('Profiling'), program]
  12. 146 q.functions = ['CMD_SCAN', 'CMD_FINISHED']
  13. 147 q.default = 'CMD_SCAN'
  14. 148 ans, arg = q.promptUser('noexit')
  15. 149
  16. 150 if ans == 'CMD_SCAN':
  17. 151 lp_ret = apparmor.do_logprof_pass(logmark, passno)
  18. 152 passno += 1
  19. ans undefined
  20. arg undefined
  21. q = <apparmor.ui.PromptQuestion object>
  22. q.promptUser = <bound method PromptQuestion.promptUser of <apparmor.ui.PromptQuestion object>>
  23.  
  24. /usr/lib/python3.6/site-packages/apparmor/ui.py in promptUser(self=<apparmor.ui.PromptQuestion object>, params='noexit')
  25. 299
  26. 300 def promptUser(self, params=''):
  27. 301 cmd = None
  28. 302 arg = None
  29. 303 if UI_mode == 'text':
  30. 304 cmd, arg = self.Text_PromptUser()
  31. 305 else:
  32. 306 self.type = 'wizard'
  33. 307 SendDataToYast(self)
  34. 308 ypath, yarg = GetDataFromYast()
  35. cmd = None
  36. arg = None
  37. self = <apparmor.ui.PromptQuestion object>
  38. self.Text_PromptUser = <bound method PromptQuestion.Text_PromptUser of <apparmor.ui.PromptQuestion object>>
  39.  
  40. /usr/lib/python3.6/site-packages/apparmor/ui.py in Text_PromptUser(self=<apparmor.ui.PromptQuestion object>)
  41. 335 if not CMDS.get(cmd, False):
  42. 336 raise AppArmorException(_('PromptUser: Unknown command %s') % cmd)
  43. 337
  44. 338 menutext = CMDS[cmd]
  45. 339
  46. 340 key = get_translated_hotkey(menutext).lower()
  47. 341 # Duplicate hotkey
  48. 342 if keys.get(key, False):
  49. 343 raise AppArmorException(_('PromptUser: Duplicate hotkey for %(command)s: %(menutext)s ') % { 'command': cmd, 'menutext': menutext })
  50. 344
  51. key undefined
  52. global get_translated_hotkey = <function get_translated_hotkey>
  53. menutext = '(S)can system log for AppArmor events'
  54. ).lower = <built-in method lower of str object>
  55.  
  56. /usr/lib/python3.6/site-packages/apparmor/ui.py in get_translated_hotkey(translated='(S)can system log for AppArmor events', cmsg='')
  57. 62
  58. 63 def get_translated_hotkey(translated, cmsg=''):
  59. 64 msg = 'PromptUser: ' + _('Invalid hotkey for')
  60. 65
  61. 66 # Originally (\S) was used but with translations it would not work :(
  62. 67 if re.search('\((\S+)\)', translated, re.LOCALE):
  63. 68 return re.search('\((\S+)\)', translated, re.LOCALE).groups()[0]
  64. 69 else:
  65. 70 if cmsg:
  66. 71 raise AppArmorException(cmsg)
  67. global re = <module 're' from '/usr/lib/python3.6/re.py'>
  68. re.search = <function search>
  69. translated = '(S)can system log for AppArmor events'
  70. re.LOCALE = <RegexFlag.LOCALE: 4>
  71.  
  72. /usr/lib/python3.6/re.py in search(pattern=r'\((\S+)\)', string='(S)can system log for AppArmor events', flags=<RegexFlag.LOCALE: 4>)
  73. 177 return _compile(pattern, flags).fullmatch(string)
  74. 178
  75. 179 def search(pattern, string, flags=0):
  76. 180 """Scan through string looking for a match to the pattern, returning
  77. 181 a match object, or None if no match was found."""
  78. 182 return _compile(pattern, flags).search(string)
  79. 183
  80. 184 def sub(pattern, repl, string, count=0, flags=0):
  81. 185 """Return the string obtained by replacing the leftmost
  82. 186 non-overlapping occurrences of the pattern in string by the
  83. global _compile = <function _compile>
  84. pattern = r'\((\S+)\)'
  85. flags = <RegexFlag.LOCALE: 4>
  86. ).search undefined
  87. string = '(S)can system log for AppArmor events'
  88.  
  89. /usr/lib/python3.6/re.py in _compile(pattern=r'\((\S+)\)', flags=<RegexFlag.LOCALE: 4>)
  90. 296 raise ValueError(
  91. 297 "cannot process flags argument with a compiled pattern")
  92. 298 return pattern
  93. 299 if not sre_compile.isstring(pattern):
  94. 300 raise TypeError("first argument must be string or compiled pattern")
  95. 301 p = sre_compile.compile(pattern, flags)
  96. 302 if not (flags & DEBUG):
  97. 303 if len(_cache) >= _MAXCACHE:
  98. 304 _cache.clear()
  99. 305 if p.flags & LOCALE:
  100. p undefined
  101. global sre_compile = <module 'sre_compile' from '/usr/lib/python3.6/sre_compile.py'>
  102. sre_compile.compile = <function compile>
  103. pattern = r'\((\S+)\)'
  104. flags = <RegexFlag.LOCALE: 4>
  105.  
  106. /usr/lib/python3.6/sre_compile.py in compile(p=r'\((\S+)\)', flags=<RegexFlag.LOCALE: 4>)
  107. 557 def compile(p, flags=0):
  108. 558 # internal: convert pattern list to internal format
  109. 559
  110. 560 if isstring(p):
  111. 561 pattern = p
  112. 562 p = sre_parse.parse(p, flags)
  113. 563 else:
  114. 564 pattern = None
  115. 565
  116. 566 code = _code(p, flags)
  117. p = r'\((\S+)\)'
  118. global sre_parse = <module 'sre_parse' from '/usr/lib/python3.6/sre_parse.py'>
  119. sre_parse.parse = <function parse>
  120. flags = <RegexFlag.LOCALE: 4>
  121.  
  122. /usr/lib/python3.6/sre_parse.py in parse(str=r'\((\S+)\)', flags=<RegexFlag.LOCALE: 4>, pattern=<sre_parse.Pattern object>)
  123. 861 pattern.flags = flags | SRE_FLAG_VERBOSE
  124. 862 pattern.str = str
  125. 863 source.seek(0)
  126. 864 p = _parse_sub(source, pattern, True, False)
  127. 865
  128. 866 p.pattern.flags = fix_flags(str, p.pattern.flags)
  129. 867
  130. 868 if source.next is not None:
  131. 869 assert source.next == ")"
  132. 870 raise source.error("unbalanced parenthesis")
  133. p = [(LITERAL, 40), (SUBPATTERN, (1, 0, 0, [(MAX_REP...GORY, CATEGORY_NOT_SPACE)])]))])), (LITERAL, 41)]
  134. p.pattern = <sre_parse.Pattern object>
  135. p.pattern.flags = <RegexFlag.LOCALE: 4>
  136. global fix_flags = <function fix_flags>
  137. str = r'\((\S+)\)'
  138.  
  139. /usr/lib/python3.6/sre_parse.py in fix_flags(src=r'\((\S+)\)', flags=<RegexFlag.LOCALE: 4>)
  140. 828
  141. 829 def fix_flags(src, flags):
  142. 830 # Check and fix flags according to the type of pattern (str or bytes)
  143. 831 if isinstance(src, str):
  144. 832 if flags & SRE_FLAG_LOCALE:
  145. 833 raise ValueError("cannot use LOCALE flag with a str pattern")
  146. 834 if not flags & SRE_FLAG_ASCII:
  147. 835 flags |= SRE_FLAG_UNICODE
  148. 836 elif flags & SRE_FLAG_UNICODE:
  149. 837 raise ValueError("ASCII and UNICODE flags are incompatible")
  150. builtinValueError = <class 'ValueError'>
  151. ValueError: cannot use LOCALE flag with a str pattern
  152. __cause__ = None
  153. __class__ = <class 'ValueError'>
  154. __context__ = None
  155. __delattr__ = <method-wrapper '__delattr__' of ValueError object>
  156. __dict__ = {}
  157. __dir__ = <built-in method __dir__ of ValueError object>
  158. __doc__ = 'Inappropriate argument value (of correct type).'
  159. __eq__ = <method-wrapper '__eq__' of ValueError object>
  160. __format__ = <built-in method __format__ of ValueError object>
  161. __ge__ = <method-wrapper '__ge__' of ValueError object>
  162. __getattribute__ = <method-wrapper '__getattribute__' of ValueError object>
  163. __gt__ = <method-wrapper '__gt__' of ValueError object>
  164. __hash__ = <method-wrapper '__hash__' of ValueError object>
  165. __init__ = <method-wrapper '__init__' of ValueError object>
  166. __init_subclass__ = <built-in method __init_subclass__ of type object>
  167. __le__ = <method-wrapper '__le__' of ValueError object>
  168. __lt__ = <method-wrapper '__lt__' of ValueError object>
  169. __ne__ = <method-wrapper '__ne__' of ValueError object>
  170. __new__ = <built-in method __new__ of type object>
  171. __reduce__ = <built-in method __reduce__ of ValueError object>
  172. __reduce_ex__ = <built-in method __reduce_ex__ of ValueError object>
  173. __repr__ = <method-wrapper '__repr__' of ValueError object>
  174. __setattr__ = <method-wrapper '__setattr__' of ValueError object>
  175. __setstate__ = <built-in method __setstate__ of ValueError object>
  176. __sizeof__ = <built-in method __sizeof__ of ValueError object>
  177. __str__ = <method-wrapper '__str__' of ValueError object>
  178. __subclasshook__ = <built-in method __subclasshook__ of type object>
  179. __suppress_context__ = False
  180. __traceback__ = <traceback object>
  181. args = ('cannot use LOCALE flag with a str pattern',)
  182. with_traceback = <built-in method with_traceback of ValueError object>
  183.  
  184. The above is a description of an error in a Python program. Here is
  185. the original traceback:
  186.  
  187. Traceback (most recent call last):
  188. File "/usr/bin/aa-genprof", line 148, in <module>
  189. ans, arg = q.promptUser('noexit')
  190. File "/usr/lib/python3.6/site-packages/apparmor/ui.py", line 304, in promptUser
  191. cmd, arg = self.Text_PromptUser()
  192. File "/usr/lib/python3.6/site-packages/apparmor/ui.py", line 340, in Text_PromptUser
  193. key = get_translated_hotkey(menutext).lower()
  194. File "/usr/lib/python3.6/site-packages/apparmor/ui.py", line 67, in get_translated_hotkey
  195. if re.search('\((\S+)\)', translated, re.LOCALE):
  196. File "/usr/lib/python3.6/re.py", line 182, in search
  197. return _compile(pattern, flags).search(string)
  198. File "/usr/lib/python3.6/re.py", line 301, in _compile
  199. p = sre_compile.compile(pattern, flags)
  200. File "/usr/lib/python3.6/sre_compile.py", line 562, in compile
  201. p = sre_parse.parse(p, flags)
  202. File "/usr/lib/python3.6/sre_parse.py", line 866, in parse
  203. p.pattern.flags = fix_flags(str, p.pattern.flags)
  204. File "/usr/lib/python3.6/sre_parse.py", line 833, in fix_flags
  205. raise ValueError("cannot use LOCALE flag with a str pattern")
  206. ValueError: cannot use LOCALE flag with a str pattern
  207.  
  208.  
  209. Please consider reporting a bug at https://bugs.launchpad.net/apparmor/
  210. and attach this file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement