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

Deprecated StopIteration from middleware.common_exception_handling with flask #1296

Open
ghost opened this issue Sep 7, 2018 · 2 comments
Open

Comments

@ghost
Copy link

ghost commented Sep 7, 2018

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.

@KyleJamesWalker
Copy link

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.

@pquentin
Copy link
Contributor

pquentin commented Sep 2, 2019

Bumping as this issue now has 13 upvotes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants