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

AttributeError: module 'collections' has no attribute 'Iterable' #32

Open
kenorb opened this issue Jan 29, 2022 · 5 comments
Open

AttributeError: module 'collections' has no attribute 'Iterable' #32

kenorb opened this issue Jan 29, 2022 · 5 comments

Comments

@kenorb
Copy link

kenorb commented Jan 29, 2022

Using the latest master, I've got the following errors:

/opt/hostedtoolcache/Python/3.10.2/x64/bin/pre-commit run --show-diff-on-failure --color=always --all-files
...
jinjalint...................................................................Failed
- hook id: jinjalint
- exit code: 1

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repobsmo5jsj/py_env-python3/bin/jinjalint", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.cache/pre-commit/repobsmo5jsj/py_env-python3/lib/python3.10/site-packages/jinjalint/cli.py", line 63, in main
    paths = list(resolve_file_paths(input_names, extensions=extensions))
  File "/home/runner/.cache/pre-commit/repobsmo5jsj/py_env-python3/lib/python3.10/site-packages/jinjalint/util.py", line 9, in flatten
    if (isinstance(el, collections.Iterable) and
AttributeError: module 'collections' has no attribute 'Iterable'
Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repobsmo5jsj/py_env-python3/bin/jinjalint", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.cache/pre-commit/repobsmo5jsj/py_env-python3/lib/python3.10/site-packages/jinjalint/cli.py", line 63, in main
    paths = list(resolve_file_paths(input_names, extensions=extensions))
  File "/home/runner/.cache/pre-commit/repobsmo5jsj/py_env-python3/lib/python3.10/site-packages/jinjalint/util.py", line 9, in flatten
    if (isinstance(el, collections.Iterable) and
AttributeError: module 'collections' has no attribute 'Iterable'

The error happens with Python v3.10.2. Works fine with v3.9.7 and v3.9.10.

Action file:

jobs:
  Pre-commit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v1
        with:
          path: ~/.cache/pre-commit
          key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}
      - uses: actions/setup-python@v1
      - uses: pre-commit/[email protected]

Pre-commit config file:

...
  - repo: https://github.com/motet-a/jinjalint
    rev: master
    hooks:
      - id: jinjalint
@aneustroev
Copy link

Same problem.

@aneustroev
Copy link

#33

@cnwme
Copy link

cnwme commented Mar 8, 2022

same issue on v 3.10 python

@Laaronhooper
Copy link

Same problem.

@xrmx
Copy link

xrmx commented Apr 6, 2023

You may want to use curlylint instead of jinjalint

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

No branches or pull requests

5 participants