Modify ↓
Opened 9 years ago
Closed 9 years ago
#12269 closed defect (fixed)
TypeError: expected string or buffer
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | plugin - spam-filter |
Component: | plugin/spamfilter | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Avoid traceback for duplicated arguments to trap fields. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Found the following in the logs:
2015-12-08 19:09:27,984 Trac[filtersystem] ERROR: Filter strategy <tracspamfilter.filters.trapfield.TrapFieldFilterStrategy object at 0x817990ac> raised exception: expected string or bufferTraceback (most recent call last): File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/filtersystem.py", line 192, in test retval = strategy.test(req, author, content, ip) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/filters/trapfield.py", line 65, in test i = shorten_line(javascript_quote(i), 50) File "build/bdist.linux-i686/egg/trac/util/text.py", line 155, in javascript_quote return _js_quote_re.sub(replace, text)TypeError: expected string or buffer
I guess the issue is probably that a sequence other than a string is being passed to javascript_quote
:
>>> javascript_quote([1, 2]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/text.py", line 152, in javascript_quote return _js_quote_re.sub(replace, text) TypeError: expected string or buffer
I wonder if this can happen through duplicated arguments (e.g. ?trap_field=1&trap_field=2
).
Attachments (0)
Change History (7)
comment:1 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 9 years ago
#12215 closed as a duplicate, but will also look into the secondary issue noted in comment:2:ticket:12215:
2015-10-22 02:26:27,839 Trac[filtersystem] ERROR: Filter strategy <tracspamfilter.captcha.api.CaptchaSystem object at 0x829d9a8c> raised exception: connection already closed Traceback (most recent call last): File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/filtersystem.py", line 217, in test self._record_action('test','empty', '', strategy, tim) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/filtersystem.py", line 466, in _record_action stats.insert_or_update(name, action, data, status, delay, 1 if strategy.is_external() else 0) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/model.py", line 396, in insert_or_update delay, delay, external, int(time()))) File "build/bdist.linux-i686/egg/trac/db/api.py", line 159, in __exit__ self.db.rollback() InterfaceError: connection already closed
comment:5 by , 9 years ago
Description: | modified (diff) |
---|
comment:6 by , 9 years ago
Description: | modified (diff) |
---|
comment:7 by , 9 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
DONE bump plugin version after this issue is resolved (comment:8:ticket:12133).
Version bumped in [14504]. I'll bump the version number more frequently in the future.