raven-python
raven-python copied to clipboard
Deprecated StopIteration from `middleware.common_exception_handling` with flask
We use raven.contrib.flask.Sentry to handle our error on flask app on python 3.5. But it produces warnings
/.../contextlib.py:99: DeprecationWarning: generator 'common_exception_handling' raised StopIteration
self.gen.throw(type, value, traceback)
I was able to trace it to middleware.common_exception_handling witch allow reraise StopIteration . But since python 3.5 generators should return to stop iteration (https://www.python.org/dev/peps/pep-0479/#converting-the-exception-inside-next). This is than catched by contexmanager decorator and this warning is produced.
It prevents us to simply use -W error to find out problems when we update requirements of our project.
Having the same error, py.test logs are flooding. We hacked out Sentry from our tests to keep cleaner test output, but I'd really like to not have a special setup for being able to see the output.
Bumping as this issue now has 13 upvotes.