Содержание
- instantiation_011 crash: re.error: unbalanced parenthesis at position 3 #420
- Comments
- Why do I get the error message ‘Unbalanced or unexpected parenthesis or bracket’ ?
- Direct link to this question
- Direct link to this question
- Accepted Answer
- Direct link to this answer
- Direct link to this answer
- Direct link to this comment
- Direct link to this comment
- More Answers (0)
- See Also
- Categories
- Products
- Community Treasure Hunt
- How to Get Best Site Performance
- Americas
- Europe
- Asia Pacific
instantiation_011 crash: re.error: unbalanced parenthesis at position 3 #420
Environment
Describe the bug
VSG Crashes with the following stack trace:
/lib/python3.7/site-packages/vsg/__main__.py», line 203, in main oRules.fix(commandLineArguments.fix_phase) File «
/lib/python3.7/site-packages/vsg/rule_list.py», line 137, in fix oRule.fix(self.oVhdlFile) File «
/lib/python3.7/site-packages/vsg/rule.py», line 73, in fix self._fix_violations(oFile) File «
/lib/python3.7/site-packages/vsg/rules/case_rule.py», line 75, in _fix_violations fix_function(oFile.lines[iLineNumber], word) File «
/lib/python3.7/site-packages/vsg/fix.py», line 88, in upper_case utils.change_word(oLine, sKeyword, sKeyword.upper()) File «
/lib/python3.7/site-packages/vsg/utils.py», line 107, in change_word tLine = re.subn(r’b’ + sWord + r’b’, sNewWord, sLine, iMax, flags=re.IGNORECASE) File «
/lib/python3.7/re.py», line 203, in subn return _compile(pattern, flags).subn(repl, string, count) File «
/lib/python3.7/re.py», line 286, in _compile p = sre_compile.compile(pattern, flags) File «
/lib/python3.7/sre_compile.py», line 764, in compile p = sre_parse.parse(p, flags) File «
/lib/python3.7/sre_parse.py», line 944, in parse raise source.error(«unbalanced parenthesis») re.error: unbalanced parenthesis at position 3″>
To Reproduce
I have narrowed the crash down to a line similar to this:
I_PORTMAP_FORMAL => I_ENTITY_INPUT(generate_loop_index)(function_call(G_GENERIC_A(generate_loop_index),8)-1 downto 0),
This line is part of a port map statement, which is for an instance being generated in a generate loop.
If I comment the line out, then vsg continues on without any additional issues.
Note, I have another line of code that looks like this which does not trigger the problem:
I_PORTMAP_FORMAL_OK => I_ENTITY_INPUT(generate_loop_index)(function_call2(G_GENERIC_A(generate_loop_index))-1 downto 0),
I suspect the problem is the function_call which requires 2 arguments, whereas function_call2 only has one argument.
Expected behavior
Crash would not occur and I don’t believe there is anything to fix here.
Screenshots
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Источник
Why do I get the error message ‘Unbalanced or unexpected parenthesis or bracket’ ?
Direct link to this question
Direct link to this question
Accepted Answer
Direct link to this answer
Direct link to this answer
1 Comment
More Answers (0)
See Also
Categories
Products
Find the treasures in MATLAB Central and discover how the community can help you!
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 简体中文 Chinese
- English
- 日本 Japanese (日本語)
- 한국 Korean (한국어)
Accelerating the pace of engineering and science
MathWorks is the leading developer of mathematical computing software for engineers and scientists.
Источник
Open
Issue created Jul 04, 2022 by
re.error: unbalanced parenthesis at position 68
I was trying to add some rules but the error happened. Python version is 3.10.5
Error log
> sudo aa-logprof
Updating AppArmor profiles in /etc/apparmor.d.
Reading log entries from /var/log/audit/audit.log.
WARNING: Ignoring exec event in thunderbird//lsb_release, nested profiles are not supported yet.
Profile: /usr/lib{64,exec}/firefox{,-beta}/firefox{,-bin}
Execute: /usr/lib64/libreoffice/program/soffice
Severity: unknown
(I)nherit / (C)hild / (P)rofile / (N)amed / (U)nconfined / (X) ix On / (D)eny / Abo(r)t / (F)inish
Traceback (most recent call last):
File "/usr/sbin/aa-logprof", line 51, in <module>
apparmor.do_logprof_pass(logmark)
File "/usr/lib/python3.10/site-packages/apparmor/aa.py", line 1507, in do_logprof_pass
log_dict = collapse_log(hashlog)
File "/usr/lib/python3.10/site-packages/apparmor/aa.py", line 1661, in collapse_log
if not hat_exists or not is_known_rule(aa[profile][hat], 'ptrace', ptrace_event):
File "/usr/lib/python3.10/site-packages/apparmor/aa.py", line 2322, in is_known_rule
if profile[rule_type].is_covered(rule_obj, False):
File "/usr/lib/python3.10/site-packages/apparmor/rule/__init__.py", line 423, in is_covered
if r.is_covered(rule, check_allow_deny, check_audit):
File "/usr/lib/python3.10/site-packages/apparmor/rule/__init__.py", line 158, in is_covered
return self.is_covered_localvars(other_rule)
File "/usr/lib/python3.10/site-packages/apparmor/rule/ptrace.py", line 141, in is_covered_localvars
if not self._is_covered_aare(self.peer, self.all_peers, other_rule.peer, other_rule.all_peers, 'peer'):
File "/usr/lib/python3.10/site-packages/apparmor/rule/__init__.py", line 204, in _is_covered_aare
if not self_value.match(other_value):
File "/usr/lib/python3.10/site-packages/apparmor/aare.py", line 75, in match
self._regex_compiled = re.compile(convert_regexp(self.regex))
File "/usr/lib64/python3.10/re.py", line 251, in compile
return _compile(pattern, flags)
File "/usr/lib64/python3.10/re.py", line 303, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib64/python3.10/sre_compile.py", line 788, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib64/python3.10/sre_parse.py", line 969, in parse
raise source.error("unbalanced parenthesis")
re.error: unbalanced parenthesis at position 68
An unexpected error occoured!
For details, see /tmp/apparmor-bugreport-4ueqo26f.txt
Please consider reporting a bug at https://gitlab.com/apparmor/apparmor/-/issues
and attach this file.
apparmor-bugreport-4ueqo26f.txt
Edited Jul 04, 2022 by Fushan Wen
Hi. Here’s the full output it gives me:
C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsite-packagesIPythonnbformatcurrent.py:19: UserWarning: IPython.nbformat.current is deprecated.
- use IPython.nbformat for read/write/validate public API
- use IPython.nbformat.vX directly to composing notebooks of a particular version
""")
Traceback (most recent call last):
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsite-packagesIPythonqtbase_frontend_mixin.py", line 138, in _dispatch
handler(msg)
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsite-packagesspyderlibwidgetsipython.py", line 335, in _handle_inspect_reply
signature = self.get_signature(content)
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsite-packagesspyderlibwidgetsipython.py", line 271, in get_signature
signature = getsignaturefromtext(text, name)
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsite-packagesspyderlibutilsdochelpers.py", line 180, in getsignaturefromtext
sigs_1 = re.findall(oneline_re + '|' + multiline_re, text)
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libre.py", line 210, in findall
return _compile(pattern, flags).findall(string)
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libre.py", line 294, in _compile
p = sre_compile.compile(pattern, flags)
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsre_compile.py", line 568, in compile
p = sre_parse.parse(p, flags)
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsre_parse.py", line 760, in parse
p = _parse_sub(source, pattern, 0)
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsre_parse.py", line 370, in _parse_sub
itemsappend(_parse(source, state))
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsre_parse.py", line 708, in _parse
p = _parse_sub(source, state)
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsre_parse.py", line 370, in _parse_sub
itemsappend(_parse(source, state))
File "C:Program FilesPythonWinPython-64bit-3.4.3.2python-3.4.3.amd64libsre_parse.py", line 710, in _parse
raise error("unbalanced parenthesis")
sre_constants.error: unbalanced parenthesis