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

Isort 5.4.0 with combine-as drops comments on some imports #1381

Closed
ziima opened this issue Aug 13, 2020 · 2 comments
Closed

Isort 5.4.0 with combine-as drops comments on some imports #1381

ziima opened this issue Aug 13, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@ziima
Copy link

ziima commented Aug 13, 2020

When applying isort on a following snippet

from smtplib import SMTPConnectError, SMTPNotSupportedError  # important comment

isort tries to drop the comment.

Command:

isort --line-length=120 --check-only --diff --combine-as /tmp/isort_comment.py

Affected version is 5.4.0, comment is untouched by isort 5.3.2. As far as I know, only this particular import is affected, I wasn't able to create another case. But the bug was reproduced on several machines.

@tpazderka
Copy link

This can be triggered by

from appsettings import AppSettings, ObjectSetting, StringSetting  # type: ignore

as well.

@timothycrosley timothycrosley added the bug Something isn't working label Aug 13, 2020
@timothycrosley
Copy link
Member

timothycrosley commented Aug 13, 2020

Thank you for reporting, I'm sorry this regression made its way through! I've added an additional regression test that tests both of these cases to the isort regression test suite and pushed a hot fix release (5.4.1) to address this regression.

Thanks!

~Timothy

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

No branches or pull requests

3 participants