raven-python icon indicating copy to clipboard operation
raven-python copied to clipboard

Deprecated StopIteration from `middleware.common_exception_handling` with flask

Open ghost opened this issue 7 years ago • 2 comments

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.

ghost avatar Sep 07 '18 11:09 ghost

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.

KyleJamesWalker avatar Sep 14 '18 22:09 KyleJamesWalker

Bumping as this issue now has 13 upvotes.

pquentin avatar Sep 02 '19 11:09 pquentin