pylint #88914 sre_constants.error: unexpected end of regular expression [validation pending]
example.py: """ example """ import struct PACKED = struct.pack('!i', 0) pylint example.py: Traceback (most recent call last): File "/usr/bin/pylint", line 4, in <module> lint.Run(sys.argv[1:]) File "/usr/lib/pymodules/python2.6/pylint/lint.py", line 879, in __init__ linter.check(args) File "/usr/lib/pymodules/python2.6/pylint/lint.py", line 502, in check self.check_astng_module(astng, walker, rawcheckers) File "/usr/lib/pymodules/python2.6/pylint/lint.py", line 574, in check_astng_module walker.walk(astng) File "/usr/lib/pymodules/python2.6/pylint/utils.py", line 528, in walk self.walk(child) File "/usr/lib/pymodules/python2.6/pylint/utils.py", line 528, in walk self.walk(child) File "/usr/lib/pymodules/python2.6/pylint/utils.py", line 528, in walk self.walk(child) File "/usr/lib/pymodules/python2.6/pylint/utils.py", line 525, in walk cb(astng) File "/usr/lib/pymodules/python2.6/pylint/checkers/typecheck.py", line 138, in visit_getattr if re.match(pattern, node.attrname): File "/usr/lib/python2.6/re.py", line 137, in match return _compile(pattern, flags).match(string) File "/usr/lib/python2.6/re.py", line 245, in _compile raise error, v # invalid expression sre_constants.error: unexpected end of regular expression | |
priority | normal |
---|---|
type | bug |
done in | <not specified> |
load left | 0.000 |
closed by | #8752260a4f41 fix crash when using set in regexp for --generated-members option. Closes #88914 |
Comments
-
2012/02/20 13:33, written by sthenault
-
2012/05/17 20:54, written by anon
-
2012/05/17 21:18, written by pimperish
-
2012/05/21 12:06, written by sthenault
add commentI don't reproduce this. Isn't it rather a pb with a bad value for generated-members in your pylintrc (which had been turned into regexp in pylint 0.24)
I am getting the same error. Pylint does not seem to be handling character classes ('[') in regular expressions very well.
I'm using the following option: --generated-members=objects,DoesNotExist,delay,retry,"[a-zA-Z]+_set"
typecheck.py contains the following comments:
# generated_members may containt regular expressions
# (surrounded by quote `"` and followed by a comma `,`)
# REQUEST,aq_parent,"[a-zA-Z]+_set{1,2}"' =>
# ('REQUEST', 'aq_parent', '[a-zA-Z]+_set{1,2}')
I've tried with and without quotes, but it always dies on the '[' character
me again...no longer anonymous. The original ticket creator (at least I think it's the same "Simon") posted a fix here:
http://stackoverflow.com/questions/115977/using-pylint-with-django#comment9254297_4162971I went ahead and created a patch, but I dunno the best way to submit it. So I'll just post it here:
thx, I was not aware of this, and will include the patch right now