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
Closed

LintMiddleware not Python 3 compatible #1510

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

Comments

@NiklasMM
Copy link
Contributor

@NiklasMM NiklasMM 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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants