Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Cannot capture exception when used with genshi #35

@rslinckx

Description

@rslinckx

When trying to render a genshi template with raven enabled I get the following traceback:

Traceback (most recent call last):
File "/Users/kikidonk/Whatever/env/kp/lib/python2.7/site-packages/flask/app.py", line 1506, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/Users/kikidonk/Whatever/env/kp/lib/python2.7/site-packages/flask/app.py", line 1181, in handle_exception
got_request_exception.send(self, exception=e)
File "/Users/kikidonk/Whatever/env/kp/lib/python2.7/site-packages/blinker/base.py", line 220, in send
for receiver in self.receivers_for(sender)]
File "/Users/kikidonk/Whatever/env/kp/lib/python2.7/site-packages/raven/contrib/flask/init.py", line 31, in _handle_exception
'app': sender.name,
File "/Users/kikidonk/Whatever/env/kp/lib/python2.7/site-packages/raven/base.py", line 219, in capture
data.update(processor.process(data))
File "/Users/kikidonk/Whatever/env/kp/lib/python2.7/site-packages/raven/processors.py", line 28, in process
for k, v in frame['vars'].iteritems():
AttributeError: 'str' object has no attribute 'iteritems'

It seems that frame['vars'] contains a string...

In utils/stacks.py:149 I see that 'vars': transform(frame.f_locals)

And upon inspection it seems that frame.f_locals is a list with a single item being a dict containing the genshi variables.

I'm guessing the transform sees a list and then stringifies it, but then other code expects it to be a dict (which it really should be).

Maybe genshi does weird stuff with f_locals ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions