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

Infinite loop on unclosed parenthesis #1917

Closed
andersk opened this issue Apr 12, 2022 · 2 comments · Fixed by #1919
Closed

Infinite loop on unclosed parenthesis #1917

andersk opened this issue Apr 12, 2022 · 2 comments · Fixed by #1919
Assignees
Labels
bug Something isn't working

Comments

@andersk
Copy link
Contributor

andersk commented Apr 12, 2022

If I run isort (5.10.1 or main at c6a4196) on this invalid file with an unclosed parenthesis, it goes into a 100% CPU infinite loop:

from os import (
@anirudnits anirudnits added the bug Something isn't working label Apr 13, 2022
@anirudnits anirudnits self-assigned this Apr 13, 2022
@anirudnits
Copy link
Collaborator

I'm looking into this. Just as a workaround using --atomic flag for such files will raise an error and prevent isort to go into an infinite loop.

@anirudnits
Copy link
Collaborator

this while condition

while ")" not in stripped_line:
seems to be going into infinite loop. There should be way to identify if we are at the end of a stream and raise an error if so.

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

Successfully merging a pull request may close this issue.

2 participants