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

flake8-coding fails on python 3.7 with "RuntimeError: generator raised StopIteration" #16

Closed
andrevmatos opened this issue Aug 28, 2018 · 1 comment · Fixed by #17
Closed

Comments

@andrevmatos
Copy link
Contributor

With PEP479 enforced on Python 3.7, raising StopIteration inside a generator causes a RuntimeError.
Simply return instead, and the generator will be terminated.
Caused by

raise StopIteration()

Full traceback:

Traceback (most recent call last):
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8_coding.py", line 55, in run
    raise StopIteration()
StopIteration

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

Traceback (most recent call last):
  File "/usr/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8/checker.py", line 648, in _run_checks
    return checker.run_checks()
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8/checker.py", line 579, in run_checks
    self.run_ast_checks()
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8/checker.py", line 493, in run_ast_checks
    for (line_number, offset, text, check) in runner:
RuntimeError: generator raised StopIteration
"""

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

Traceback (most recent call last):
  File "/sec/Dev/BrainBot/raiden/venv/bin/flake8", line 11, in <module>
    sys.exit(main())
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8/main/cli.py", line 16, in main
    app.run(argv)
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8/main/application.py", line 396, in run
    self._run(argv)
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8/main/application.py", line 384, in _run
    self.run_checks()
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8/main/application.py", line 310, in run_checks
    self.file_checker_manager.run()
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8/checker.py", line 319, in run
    self.run_parallel()
  File "/sec/Dev/BrainBot/raiden/venv/lib/python3.7/site-packages/flake8/checker.py", line 288, in run_parallel
    for ret in pool_map:
  File "/usr/lib/python3.7/multiprocessing/pool.py", line 354, in <genexpr>
    return (item for chunk in result for item in chunk)
  File "/usr/lib/python3.7/multiprocessing/pool.py", line 748, in next
    raise value
RuntimeError: generator raised StopIteration
make: *** [Makefile:41: lint] Error 1
@LefterisJP
Copy link

+1 on that issue. Any ETA on when the fix at #17 can be reviewed and merged and a new release made?

LefterisJP added a commit to LefterisJP/raiden that referenced this issue Sep 6, 2018
It does not work with python 3.7 and renders flake8 unusable (it crashes). An issue along
with a fix has been reported to the maintainer
[here](tk0miya/flake8-coding#16) but the repo seems to
no longer be actively maintained.

And to be honest we don't really need this module. The only thing it adds is a
check for the magic comment in the beginning of the file.

[skip ci]
LefterisJP added a commit to LefterisJP/raiden that referenced this issue Sep 6, 2018
It does not work with python 3.7 and renders flake8 unusable (it crashes). An issue along
with a fix has been reported to the maintainer
[here](tk0miya/flake8-coding#16) but the repo seems to
no longer be actively maintained.

And to be honest we don't really need this module. The only thing it adds is a
check for the magic comment in the beginning of the file.

[skip ci]
LefterisJP added a commit to raiden-network/raiden that referenced this issue Sep 6, 2018
It does not work with python 3.7 and renders flake8 unusable (it crashes). An issue along
with a fix has been reported to the maintainer
[here](tk0miya/flake8-coding#16) but the repo seems to
no longer be actively maintained.

And to be honest we don't really need this module. The only thing it adds is a
check for the magic comment in the beginning of the file.

[skip ci]
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.

2 participants