Edgewall Software
Modify

Opened 13 years ago

Closed 13 years ago

Last modified 3 years ago

#9905 closed defect (fixed)

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Reported by: Christian Boos Owned by: Dirk Stöcker
Priority: normal Milestone: plugin - spam-filter
Component: plugin/spamfilter Version: 0.13dev
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

I've updated the SpamFilter to 0.4.3dev (r10360) on http://trac.edgewall.org/demo-0.13. In the Bayes admin panel, submitting some spam or ham yields the following backtrace…

How to Reproduce

While doing a POST operation on /admin/spamfilter/bayes, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'__FORM_TOKEN': u'b2d08ba806dad9207fe002c8',
 'cat_id': u'spamfilter',
 'content': u'this is a test...',
 'min_training': u'25',
 'panel_id': u'bayes',
 'path_info': None,
 'train': u'Train as Ham'}

User agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10

System Information

Trac 0.13dev-r10358
Babel 0.9.5
Docutils 0.6
Genshi 0.7dev-r1134
GIT 1.7.1.rc1.21.gf3bd6
Mercurial 1.7
Pygments 1.3.1dev-20100812
pysqlite 2.5.6
Python 2.5.2 (r252:60911, Oct 5 2008, 19:49:54)
[GCC 4.3.2]
setuptools 0.6c9
SQLite 3.6.20
Subversion 1.5.1 (r32289)
jQuery 1.4.3

Enabled Plugins

TracGit 0.12.0.5dev
TracMercurial 0.13.0.1dev-r10329
TracSpamFilter 0.4.3dev-r10360

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 511, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-x86_64/egg/trac/admin/web_ui.py", line 122, in process_request
    path_info)
  File "/usr/local/virtualenv/0.13dev/lib/python2.5/site-packages/TracSpamFilter-0.4.3dev_r10360-py2.5.egg/tracspamfilter/admin.py", line 351, in render_admin_panel
    spam='spam' in req.args['train'].lower())
  File "/usr/local/virtualenv/0.13dev/lib/python2.5/site-packages/TracSpamFilter-0.4.3dev_r10360-py2.5.egg/tracspamfilter/filters/bayes.py", line 75, in train
    testcontent = author+"\n"+content
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

author was None.

Attachments (0)

Change History (4)

comment:1 by Christian Boos, 13 years ago

Description: modified (diff)

comment:2 by Dirk Stöcker, 13 years ago

Resolution: fixed
Status: newclosed

Fixed in r10361.

comment:3 by Christian Boos, 13 years ago

Thanks! Sites updated (btw, you now also have the SPAM_ADMIN and CONFIG_VIEW permissions on the demo sites).

comment:4 by Remy Blank, 13 years ago

Milestone: plugin - spam-filter

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Dirk Stöcker.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Dirk Stöcker 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.