Opened 15 years ago
Closed 15 years ago
#9460 closed enhancement (fixed)
TypeError: not indexable
| Reported by: | anonymous | Owned by: | Christian Boos |
|---|---|---|---|
| Priority: | high | Milestone: | plugin - spam-filter |
| Component: | plugin/spamfilter | Version: | 0.12dev |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Как воспроизвести
При выполнении операции POST по /attachment/ticket/9183/, Trac выдает внутреннюю ошибку.
(просьба предоставить дополнительные подробности здесь)
Параметры запроса:
{'__FORM_TOKEN': u'7ae6a361ea2439c8a1dd6b15',
'action': u'new',
'attachment': FieldStorage('attachment', 'toc.htm', '<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r\n<script src="js/displayToc.js"></script>\r\n<link rel="stylesheet" href="css/eacont.css" />\r\n</head>\r\n<body onload="tocInit()">\r\n</body>\r\n</html>'),
'author': u'anonymous',
'description': u'njr njr njr',
'id': u'9183',
'path': u'9183/',
'realm': u'ticket'}
User agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
Системная информация
Системная информация недоступна
Включенные плагины
Информация о плагинах недоступна
Python Traceback
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 513, in _dispatch_request
dispatcher.dispatch(req)
File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 235, in dispatch
resp = chosen_handler.process_request(req)
File "build/bdist.linux-x86_64/egg/trac/attachment.py", line 448, in process_request
self._do_save(req, attachment)
File "build/bdist.linux-x86_64/egg/trac/attachment.py", line 655, in _do_save
attachment):
File "/usr/local/virtualenv/trunk/lib/python2.5/site-packages/TracSpamFilter-0.3.2dev_r9893-py2.5.egg/tracspamfilter/adapters.py", line 134, in validate_attachment
if upload:
File "/usr/lib/python2.5/cgi.py", line 633, in __len__
return len(self.keys())
File "/usr/lib/python2.5/cgi.py", line 609, in keys
raise TypeError, "not indexable"
TypeError: not indexable
Attachments (0)
Change History (3)
comment:1 by , 15 years ago
| Component: | general → plugin/spamfilter |
|---|---|
| Milestone: | next-major-0.1X → plugin - spam-filter |
| Owner: | set to |
| Priority: | normal → high |
comment:2 by , 15 years ago
Fixed in r9920.
The fix for 'content' was already there, the check for is not None is nicer so I didn't backport r9467.
I'll nevertheless update the mergeinfo property so that we can see in source:/plugins/0.12/spam-filter-captcha if there are any changesets remaining on the 0.11 branch (eligible link).
comment:3 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
svn:mergeinfo properties are now correct in r9922.



Oops… reproduced.
Seems like the following fixes it:
tracspamfilter/adapters.py
:Strange though, as we had that change in the 0.11 version as well… Oh well, that was a known issue (r9467).