dcramer/sentry — Issue #335: Issues with some exceptions
Author: 23doors
Created: 2012-02-03 16:52:43+00:00
State: open

E.g.:

{{
HTTPError: HTTP Error 400: Bad Request
ERROR 2012-02-03 17:49:03,135 sentry.errors: Error indexing document: expected string or buffer
Traceback (most recent call last):
File "/opt/local/srv/python-environments/hydra/lib/python2.7/site-packages/sentry/manager.py", line 342, in from_kwargs
SearchDocument.objects.index(event)
File "/opt/local/srv/python-environments/hydra/lib/python2.7/site-packages/sentry/manager.py", line 692, in index
values = itertools.chain(*[self._tokenize(v) for v in values])
File "/opt/local/srv/python-environments/hydra/lib/python2.7/site-packages/sentry/manager.py", line 616, in _tokenize
text = self.PUNCTUATION_CHARS.sub(' ', text)
TypeError: expected string or buffer
}}

Changing line 616 of sentry/manager.py to:
{{
text = self.PUNCTUATION_CHARS.sub(' ', str(text))
}}

Fixes this. Although I am unsure if it shouldnt detect first if text is basestring and only if it is not, then convert to str.