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
Incompatible with Jinja2 v3 #1060
Milestone
Comments
Also running into this problem. |
This is a change in behaviour between Jinja2 v2 and Jinja2 v3. |
Same issue |
klette
added a commit
to klette/jinja
that referenced
this issue
Oct 27, 2021
This fixes a regression in commit 6029341 that changed the `__hash__` implementation of Node from the default pointer hash, to a hash based on the node fields. Since these fields contains list objects, they are not hashable, making every call to `Node.__hash__` fail. This breaks some third-party usage such as in `django-compressor` (See: django-compressor/django-compressor#1060) This changed reverts the hash method back to using `object.__hash__` as the hash implementation.
klette
added a commit
to klette/jinja
that referenced
this issue
Oct 27, 2021
This fixes a regression in commit 6029341 that changed the `__hash__` implementation of Node from the default pointer hash, to a hash based on the node fields. Since these fields contains list objects, they are not hashable, making every call to `Node.__hash__` fail. This breaks some third-party usage such as in `django-compressor` (See: django-compressor/django-compressor#1060) This changed reverts the hash method back to using `object.__hash__` as the hash implementation.
6 tasks
davidism
pushed a commit
to klette/jinja
that referenced
this issue
Nov 9, 2021
This fixes a regression in commit 6029341 that changed the `__hash__` implementation of Node from the default pointer hash, to a hash based on the node fields. Since these fields contains list objects, they are not hashable, making every call to `Node.__hash__` fail. This breaks some third-party usage such as in `django-compressor` (See: django-compressor/django-compressor#1060) This changed reverts the hash method back to using `object.__hash__` as the hash implementation.
davidism
pushed a commit
to klette/jinja
that referenced
this issue
Nov 9, 2021
This fixes a regression in commit 6029341 that changed the `__hash__` implementation of Node from the default pointer hash, to a hash based on the node fields. Since these fields contains list objects, they are not hashable, making every call to `Node.__hash__` fail. This breaks some third-party usage such as in `django-compressor` (See: django-compressor/django-compressor#1060) This changed reverts the hash method back to using `object.__hash__` as the hash implementation.
The change here was reverted in Jinga v3.0.3 See pallets/jinja#1522. Anyone want to confirm? |
carltongibson
added a commit
to carltongibson/django-compressor
that referenced
this issue
Dec 7, 2021
Shows compatibility with Jinja v3. Closes django-compressor#1060.
carltongibson
added a commit
that referenced
this issue
Dec 7, 2021
Shows compatibility with Jinja v3. Closes #1060.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
File "django-compressor/compressor/management/commands/compress.py", line 207, in compress template_nodes = compressor_nodes.setdefault(template, OrderedDict()) File "jinja2/nodes.py", line 245, in __hash__ return hash(tuple(self.iter_fields())) TypeError: unhashable type: 'list'
Also tried the latest version on develop (as of today).
The text was updated successfully, but these errors were encountered: