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

ERROR: Unrecoverable exception thrown ... This should NEVER happen. #1570

Closed
johanlundberg opened this issue Oct 20, 2020 · 1 comment · Fixed by #1572
Closed

ERROR: Unrecoverable exception thrown ... This should NEVER happen. #1570

johanlundberg opened this issue Oct 20, 2020 · 1 comment · Fixed by #1572
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@johanlundberg
Copy link

Doing as I am told :)

ERROR: Unrecoverable exception thrown when parsing src/eduid_webapp/eidas/app.py! This should NEVER happen.
If encountered, please open an issue: https://github.com/PyCQA/isort/issues/new
Traceback (most recent call last):
  File "/home/lundberg/python-environments/eduid-webapp/bin/isort", line 8, in <module>
    sys.exit(main())
  File "/home/lundberg/python-environments/eduid-webapp/lib/python3.8/site-packages/isort/main.py", line 953, in main
    for sort_attempt in attempt_iterator:
  File "/home/lundberg/python-environments/eduid-webapp/lib/python3.8/site-packages/isort/main.py", line 939, in <genexpr>
    sort_imports(  # type: ignore
  File "/home/lundberg/python-environments/eduid-webapp/lib/python3.8/site-packages/isort/main.py", line 95, in sort_imports
    incorrectly_sorted = not api.sort_file(
  File "/home/lundberg/python-environments/eduid-webapp/lib/python3.8/site-packages/isort/api.py", line 324, in sort_file
    changed = sort_stream(
  File "/home/lundberg/python-environments/eduid-webapp/lib/python3.8/site-packages/isort/api.py", line 158, in sort_stream
    changed = core.process(
  File "/home/lundberg/python-environments/eduid-webapp/lib/python3.8/site-packages/isort/core.py", line 332, in process
    parsed_content = parse.file_contents(import_section, config=config)
  File "/home/lundberg/python-environments/eduid-webapp/lib/python3.8/site-packages/isort/parse.py", line 432, in file_contents
    root = imports[placed_module][type_of_import]  # type: ignore
KeyError: 'LOCALFOLDER'

The offending file is here https://github.com/SUNET/eduid-webapp/blob/master/src/eduid_webapp/eidas/app.py.

@johanlundberg
Copy link
Author

The fix was to add LOCALFOLDER to our section config in setup.cfg.

sections = FUTURE,STDLIB,THIRDPARTY,EDUID,FIRSTPARTY,LOCALFOLDER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants