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

Unrecoverable exception thrown using --sort-reexports #2252

Open
staceybellerose opened this issue Mar 20, 2024 · 0 comments
Open

Unrecoverable exception thrown using --sort-reexports #2252

staceybellerose opened this issue Mar 20, 2024 · 0 comments

Comments

@staceybellerose
Copy link

When using --sort-reexports, I get the following error. Without the flag, it works just fine. This is in isort version 5.13.2

$ isort -c --sort-reexports .
ERROR: Unrecoverable exception thrown when parsing ./widgets/__init__.py! This should NEVER happen.
If encountered, please open an issue: https://github.com/PyCQA/isort/issues/new
Traceback (most recent call last):
  File "xxx/venv/bin/isort", line 8, in <module>
    sys.exit(main())
  File "xxx/venv/lib/python3.9/site-packages/isort/main.py", line 1228, in main
    for sort_attempt in attempt_iterator:
  File "xxx/venv/lib/python3.9/site-packages/isort/main.py", line 1212, in <genexpr>
    sort_imports(  # type: ignore
  File "xxx/venv/lib/python3.9/site-packages/isort/main.py", line 87, in sort_imports
    incorrectly_sorted = not api.check_file(file_name, config=config, **kwargs)
  File "xxx/venv/lib/python3.9/site-packages/isort/api.py", line 338, in check_file
    return check_stream(
  File "xxx/venv/lib/python3.9/site-packages/isort/api.py", line 264, in check_stream
    changed: bool = sort_stream(
  File "xxx/venv/lib/python3.9/site-packages/isort/api.py", line 210, in sort_stream
    changed = core.process(
  File "xxx/venv/lib/python3.9/site-packages/isort/core.py", line 153, in process
    sort_section_pointer += output_stream.write(sorted_code)
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'

The file in question is this.

from .dropdown import DropDown
from .meter import Meter
from .scalespinner import ScaleSpinner
from .tooltip import ToolTip
from .url_label import UrlLabel

__all__ = ["DropDown", "Meter", "ScaleSpinner", "ToolTip", "UrlLabel"]
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

No branches or pull requests

1 participant