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

TypeError: argument of type 'NoneType' is not iterable #241

Open
ppanchal-mobiz opened this issue Mar 26, 2024 · 3 comments
Open

TypeError: argument of type 'NoneType' is not iterable #241

ppanchal-mobiz opened this issue Mar 26, 2024 · 3 comments

Comments

@ppanchal-mobiz
Copy link

ppanchal-mobiz commented Mar 26, 2024

I can run linting locally using python -m flake8 --ignore E128,E302,E305,W292,BLK100 --max-line-length 120 --exclude .venv command without showing up any errors, but my linting GitHub Action suddenly started failing with the following error. Everything was working as expected until a few days ago.

/opt/hostedtoolcache/Python/3.12.0/x64/bin/flake8 --ignore E128,E302,E305,W292,BLK100 --max-line-length 120 backend
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/flake8/checker.py", line 83, in _mp_run
    ).run_checks()
      ^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/flake8/checker.py", line 526, in run_checks
    self.run_ast_checks()
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/flake8/checker.py", line 428, in run_ast_checks
    for line_number, offset, text, _ in runner:
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/bugbear.py", line 61, in run
    if self.should_warn(e.message[:4]):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/bugbear.py", line 153, in should_warn
    if code[:i] in self.options.select:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.0/x64/bin/flake8", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/flake8/main/cli.py", line 23, in main
    app.run(argv)
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/flake8/main/application.py", line 198, in run
    self._run(argv)
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/flake8/main/application.py", line 187, in _run
    self.run_checks()
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/flake8/main/application.py", line 103, in run_checks
    self.file_checker_manager.run()
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/flake8/checker.py", line 236, in run
    self.run_parallel()
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/flake8/checker.py", line 205, in run_parallel
    self.results = list(pool.imap_unordered(_mp_run, self.filenames))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/multiprocessing/pool.py", line 873, in next
    raise value
TypeError: argument of type 'NoneType' is not iterable
Error: The process '/opt/hostedtoolcache/Python/3.12.0/x64/bin/flake8' failed with exit code 1

Snippet of the workflow file:

- name: Flake8 linting
          uses: py-actions/flake8@v2
          with:
            ignore: "E128,E302,E305,W292,BLK100"
            max-line-length: 120
            path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
            plugins: "flake8-bugbear==22.1.11 flake8-black"
@Enitoxy
Copy link

Enitoxy commented Apr 18, 2024

Same exact error happening, I hope there's a fix soon

@ppanchal-mobiz
Copy link
Author

Following up as we are still facing the issue. Thank you.

@zjordan-zhang
Copy link

Had similar issue, changing Python version to be <= 3.10 seems to work for me.

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

3 participants