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

4.0.0 crashes with TypeError #1408

Closed
felixxm opened this issue Oct 11, 2021 · 7 comments · Fixed by #1410
Closed

4.0.0 crashes with TypeError #1408

felixxm opened this issue Oct 11, 2021 · 7 comments · Fixed by #1410
Milestone

Comments

@felixxm
Copy link

felixxm commented Oct 11, 2021

We noticed a regression in flake8==4.0.0 bisected to the d1a4043. Running flake8 on the Django repository crashes, e.g.

$ flake8
Traceback (most recent call last):
  File "/.virtualenvs/django-test-3.8/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/.virtualenvs/django-test-3.8/lib/python3.8/site-packages/flake8/main/cli.py", line 22, in main
    app.run(argv)
  File "/.virtualenvs/django-test-3.8/lib/python3.8/site-packages/flake8/main/application.py", line 375, in run
    self._run(argv)
  File "/.virtualenvs/django-test-3.8/lib/python3.8/site-packages/flake8/main/application.py", line 364, in _run
    self.run_checks()
  File "/.virtualenvs/django-test-3.8/lib/python3.8/site-packages/flake8/main/application.py", line 271, in run_checks
    self.file_checker_manager.run()
  File "/.virtualenvs/django-test-3.8/lib/python3.8/site-packages/flake8/checker.py", line 307, in run
    self.run_parallel()
  File "/.virtualenvs/django-test-3.8/lib/python3.8/site-packages/flake8/checker.py", line 274, in run_parallel
    filename, results, statistics = ret
TypeError: cannot unpack non-iterable NoneType object

flake8 is installed via pip:

$ python -m pip install flake8
$ flake8 --bug-report
{
  "dependencies": [],
  "platform": {
    "python_implementation": "CPython",
    "python_version": "3.8.10",
    "system": "Linux"
  },
  "plugins": [
    {
      "is_local": false,
      "plugin": "assertive",
      "version": "1.3.0"
    },
    {
      "is_local": false,
      "plugin": "mccabe",
      "version": "0.6.1"
    },
    {
      "is_local": false,
      "plugin": "pycodestyle",
      "version": "2.8.0"
    },
    {
      "is_local": false,
      "plugin": "pyflakes",
      "version": "2.4.0"
    }
  ],
  "version": "4.0.0"
}
@felixxm
Copy link
Author

felixxm commented Oct 11, 2021

It doesn't crash with a single subprocess:

flake8 -j 1

@sigmavirus24
Copy link
Member

Do you have a minimal code example of when this happens?

wmfgerrit pushed a commit to wikimedia/operations-software-spicerack that referenced this issue Oct 11, 2021
* Due to an upstream bug in the lastest 4.0.0 release limit the
  concurrency of the flake8 checks to prevent failures.
  See also: PyCQA/flake8#1408

Change-Id: I45a9808b0e442d6fefeb8abdadb1a67498bd4eda
@arporter
Copy link

This should do it:

git clone https://github.com/stfc/PSyclone.git
cd PSyclone
flake8 --exit-zero src/psyclone/tests/test_files/dynamo0p3

If I run flake8 on the files in that directory individually then all is well. It only crashes when given the directory.

@felixxm
Copy link
Author

felixxm commented Oct 11, 2021

Do you have a minimal code example of when this happens?

I narrowed this issue to a single directory in our test suite: tests/test_runner_apps/tagged

$ flake8 tests/test_runner_apps/tagged
...
  File "/.virtualenvs/django-test-3.8/lib/python3.8/site-packages/flake8/checker.py", line 274, in run_parallel
    filename, results, statistics = ret
TypeError: cannot unpack non-iterable NoneType object

@felixxm
Copy link
Author

felixxm commented Oct 11, 2021

It works when I delete a file with the syntax error which is in it 🤔.

@arporter
Copy link

Yes, one of the files in the directory that causes problems for us also has a (deliberate) syntax error in it.

@felixxm
Copy link
Author

felixxm commented Oct 11, 2021

Many thanks!

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

Successfully merging a pull request may close this issue.

4 participants