Opened on 03/05/2019 at 01:00:03 AM
Closed on 03/05/2019 at 10:04:40 PM
#7325 closed defect (fixed)
[python-abp] Allow the parser to handle filters than begin and end with '%'
Reported by: | rhowell | Assignee: | rhowell |
---|---|---|---|
Priority: | P3 | Milestone: | |
Module: | Sitescripts | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by rhowell)
Environment
Both python2 and python3, when trying to parse filters like: "%22banner%*%22idzone%", "%22request_id%*%22idzone%", and "%22zones%*%22popunder%" (used in https://easylist-downloads.adblockplus.org/liste_fr.txt).
How to reproduce
$ python
import abp.filters.rpy
abp.filters.rpy.line2dict("%22banner%*%22idzone%")
Observed behaviour
abp.filters.rpy.line2dict("%22banner%*%22idzone%")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "abp/filters/rpy.py", line 95, in line2dict
return strings2utf8(tuple2dict(parse_line(text, mode)))
File "abp/filters/parser.py", line 310, in parse_line
return _parse_instruction(stripped)
File "abp/filters/parser.py", line 158, in _parse_instruction
raise ParseError('Unrecognized instruction', text)
abp.filters.parser.ParseError: Unrecognized instruction in "%22banner%*%22idzone%"
Expected behaviour
Properly parse the filter:
'in': b'%22banner%*%22idzone%',
'out': {
b'type': b'Filter',
b'text': b'%22banner%*%22idzone%',
b'selector': {b'type': b'url-pattern',
b'value': b'%22banner%*%22idzone%'},
b'action': b'block',
b'options': [],
}
Attachments (0)
Change History (5)
comment:2 Changed on 03/05/2019 at 01:18:23 AM by rhowell
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:3 Changed on 03/05/2019 at 01:59:09 PM by kvas
- Priority changed from Unknown to P3
comment:4 Changed on 03/05/2019 at 09:18:26 PM by abpbot
comment:5 Changed on 03/05/2019 at 10:04:40 PM by rhowell
- Resolution set to fixed
- Status changed from reviewing to closed
A commit referencing this issue has landed:
Issue 7325 - Let the parser handle filters than begin and end with '%'