Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LintMiddleware not Python 3 compatible #1510

Closed
NiklasMM opened this issue Apr 10, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@NiklasMM
Copy link
Contributor

commented Apr 10, 2019

Accessing a Werkzeug-Application with an active LintMiddleware raises an error:

AttributeError: 'ClosingIterator' object has no attribute 'next'

That's because this part of it is not Python 3 compatible:

class GuardedIterator(object):
def __init__(self, iterator, headers_set, chunks):
self._iterator = iterator
self._next = iter(iterator).next
self.closed = False
self.headers_set = headers_set
self.chunks = chunks

A possible fix would be to set self._next to iter(iterator).__next__ if run under Python 3.

NiklasMM added a commit to NiklasMM/werkzeug that referenced this issue Apr 22, 2019

NiklasMM added a commit to NiklasMM/werkzeug that referenced this issue May 3, 2019

@davidism davidism added this to the 0.15.3 milestone May 8, 2019

@davidism davidism closed this May 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.