Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12181 closed defect (fixed)

Traceback in logs after page delete

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: plugin - spam-filter
Component: plugin/spamfilter Version:
Severity: normal Keywords:
Cc: stoecker Branch:
Release Notes:

Patterns on BadContent page are validated before saving the page. This fixes an issue in which the page could not be viewed or edited after saving content with a bad pattern, due to an exception when viewing the page.

API Changes:
Internal Changes:

Description

2015-08-22 05:51:56,292 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 551, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 244, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/trac/wiki/web_ui.py", line 161, in process_request
    self._do_delete(req, versioned_page)
  File "build/bdist.linux-i686/egg/trac/wiki/web_ui.py", line 276, in _do_delete
    page.delete(version, db)
  File "build/bdist.linux-i686/egg/trac/wiki/model.py", line 122, in delete
    listener.wiki_page_version_deleted(self)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/filters/regex.py", line 88, in wiki_page_changed
    self._load_patterns(page)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/filters/regex.py", line 101, in _load_patterns
    self.patterns = [re.compile(p.strip()) for p in lines if p.strip()]
  File "/usr/lib/python2.6/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.6/re.py", line 245, in _compile
    raise error, v # invalid expression
error: multiple repeat

I'll investigate the cause.

Attachments (0)

Change History (3)

comment:1 by Ryan J Ollos, 9 years ago

Owner: changed from Dirk Stöcker to Ryan J Ollos
Status: newassigned

comment:2 by Ryan J Ollos, 9 years ago

Cc: stoecker added

An error will be raised when modifying (create/save/delete/delete version) a wiki page that contains a regex that can't be compiled. The error is raised in an IWikiChangeListener method, after the page has been modified: plugins/1.0/spam-filter/tracspamfilter/filters/regex.py@14824:98#L94.

This has been the behavior since the plugin was published in r3151.

We should validate the page content in an implementation of IWikiPageManipulator, so that the page can't be saved with an invalid regex.

comment:3 by Ryan J Ollos, 9 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed
Last edited 9 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.