Isort: ERROR: Unrecoverable exception thrown ... This should NEVER happen.

Created on 20 Oct 2020  路  1Comment  路  Source: PyCQA/isort

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.

bug documentation

Most helpful comment

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

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

>All comments

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peteboothroyd picture peteboothroyd  路  3Comments

darkclouder picture darkclouder  路  3Comments

whg517 picture whg517  路  3Comments

ionelmc picture ionelmc  路  3Comments

AlexandreYang picture AlexandreYang  路  3Comments