Modify ↓
#12659 closed defect (fixed)
SpamFilter ParseError: no element found: line 1, column 0
Reported by: | Christian Boos | Owned by: | Christian Boos |
---|---|---|---|
Priority: | normal | Milestone: | plugin - spam-filter |
Component: | plugin/spamfilter | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
How to Reproduce
While doing a GET operation on /admin/spamfilter/monitor
, Trac issued an internal error.
(please provide additional details here)
Request parameters:
{'cat_id': u'spamfilter', 'panel_id': u'monitor', 'path_info': None}
User agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
System Information
Trac | 1.3.2.dev0
|
Babel | 2.3.4
|
Docutils | 0.11
|
Genshi | 0.7 (with speedups)
|
GIT | 1.9.1
|
Jinja2 | 2.9.3
|
Pillow | 2.3.0
|
Pygments | 2.1.3
|
pysqlite | 2.6.0
|
Python | 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
|
pytz | 2016.6.1
|
setuptools | 25.2.0
|
SQLite | 3.8.2
|
Subversion | 1.8.8 (r1568071)
|
jQuery | 1.11.3
|
jQuery UI | 1.11.4
|
jQuery Timepicker | 1.5.5
|
Enabled Plugins
MilestoneOperation | N/A
|
new-ticket-in-milestone | r6326
|
TracSpamFilter | 1.3.0.dev0
|
vulnerability-tickets | N/A
|
Interface Customization
shared-htdocs | |
shared-templates | |
site-htdocs | Henri.png , LinLibertineWOFF-5.3.0 , Thumbs.db , style.css , style.css~
|
site-templates | --list_of_attachments.html , site.html , site_head.html
|
Python Traceback
Traceback (most recent call last): File "/mnt/d/Trac/repos/trunk/trac/web/main.py", line 630, in _dispatch_request dispatcher.dispatch(req) File "/mnt/d/Trac/repos/trunk/trac/web/main.py", line 252, in dispatch resp = chosen_handler.process_request(req) File "/mnt/d/Trac/repos/trunk/trac/admin/web_ui.py", line 96, in process_request resp = provider.render_admin_panel(req, cat_id, panel_id, path_info) File "/mnt/d/Trac/plugins/spam-filter-trunk/tracspamfilter/admin.py", line 97, in render_admin_panel data = self._render_monitoring_panel(req, cat, page) File "/mnt/d/Trac/plugins/spam-filter-trunk/tracspamfilter/admin.py", line 229, in _render_monitoring_panel offset=offset)) File "/mnt/d/Trac/plugins/spam-filter-trunk/tracspamfilter/model.py", line 260, in _doselect yield cls._from_db(env, row) File "/mnt/d/Trac/plugins/spam-filter-trunk/tracspamfilter/model.py", line 268, in _from_db fields[9] = cls._xml_to_reasons(fields[9]) File "/mnt/d/Trac/plugins/spam-filter-trunk/tracspamfilter/model.py", line 297, in _xml_to_reasons root = ElementTree.fromstring(xml) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1301, in XML return parser.close() File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1654, in close self._raiseerror(v) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror raise err ParseError: no element found: line 1, column 0
Attachments (1)
Change History (6)
comment:1 by , 8 years ago
by , 8 years ago
Attachment: | t12659-cope-with-empty-or-non-XML-reasons.diff added |
---|
more robust handling of spamfilter_log.reasons
db content
comment:2 by , 8 years ago
Looks like a good change. I'd just move the for r in list(root)
block to an else
clause since it can't raise the exception that's being trapped.
comment:3 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 8 years ago
Owner: | changed from | to
---|
comment:5 by , 6 years ago
Milestone: | → plugin - spam-filter |
---|
Note:
See TracTickets
for help on using tickets.
I realize I probably have garbage in the
spamfilter_log
table, but then, I didn't put it by hand and is probably there due to having used some intermediate version of SpamFilter.Anyway, the fix I propose can't hurt, I think.