mitsuhiko/werkzeug — pull request #504 by ko (2014-03-14 09:58:35+00:00)
Title: check for a NoneType iterable

While working on a Flask application, I ran into the following backtrace:

> Traceback (most recent call last):
> File "/path/to/venv/lib/python2.7/site-packages/werkzeug/wsgi.py", line 682, in __next__
> return self._next()
> File "/path/to/venv/lib/python2.7/site-packages/werkzeug/wrappers.py", line 82, in _iter_encoded
> for item in iterable:
> TypeError: 'NoneType' object is not iterable

This was hit when the "request.method == 'OPTIONS'" (which apparently does not have anything to encode?).