WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

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

@ppanchal-mobiz

Description

@ppanchal-mobiz

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions