Opened 8 years ago
Last modified 8 years ago
#12269 closed defect
TypeError: expected string or buffer — at Initial Version
Reported by: | Ryan J Ollos | Owned by: | Dirk Stöcker |
---|---|---|---|
Priority: | normal | Milestone: | plugin - spam-filter |
Component: | plugin/spamfilter | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
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
).
Note:
See TracTickets
for help on using tickets.