Subject match filtering - followup patch request

Veronika Kabatova vkabatov at redhat.com
Fri Mar 9 01:25:33 AEDT 2018


----- Original Message -----
> From: "Daniel Axtens" <dja at axtens.net>
> To: vkabatov at redhat.com, patchwork at lists.ozlabs.org
> Sent: Thursday, March 8, 2018 12:38:22 PM
> Subject: Subject match filtering - followup patch request
> 
> Hi Veronika,
> 

Hi,

> 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?
> 

Sounds reasonable. I added it to my TODO list and will take a look
at it as I have time, hopefully sometime next week.

> No rush.
> 
> Thanks in advance.
> 
> Regards,
> Daniel
> 

Veronika


More information about the Patchwork mailing list