Subject match filtering - followup patch request
Daniel Axtens
dja at axtens.net
Thu Mar 8 22:38:22 AEDT 2018
Hi Veronika,
I tried to use the subject match filter and clearly got the RE wrong, as I
get the following messages when trying to parse mail.
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/patchwork/patchwork/patchwork/management/commands/parsearchive.py", line 100, in handle
obj = parse_mail(msg, options['list_id'])
File "/home/patchwork/patchwork/patchwork/parser.py", line 959, in parse_mail
project = find_project(mail, list_id)
File "/home/patchwork/patchwork/patchwork/parser.py", line 205, in find_project
project = find_project_by_id_and_subject(listid, clean_subject)
File "/home/patchwork/patchwork/patchwork/parser.py", line 173, in find_project_by_id_and_subject
re.MULTILINE | re.IGNORECASE):
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 855, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib/python3.6/sre_parse.py", line 416, in _parse_sub
not nested and not items))
File "/usr/lib/python3.6/sre_parse.py", line 523, in _parse
source.tell() - here)
sre_constants.error: unterminated character set at position 2
Please could you add a hook somehwere (perhaps the .save() of the
Project model, but wherever is easy is fine) that checks if the RE
compiles before committing it to the database?
No rush.
Thanks in advance.
Regards,
Daniel
More information about the Patchwork
mailing list