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

New line added on windows but works fine for linux for 5.0.3 #1278

Closed
AlexandreYang opened this issue Jul 6, 2020 · 3 comments
Closed

New line added on windows but works fine for linux for 5.0.3 #1278

AlexandreYang opened this issue Jul 6, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@AlexandreYang
Copy link
Contributor

AlexandreYang commented Jul 6, 2020

Hi, first thanks for the awesome work on isort,

It seems there is an issue with isort 5.0.3 on Windows.
The example below is failing on Windows but works on Linux.

isort_test_file.py:

try:
    import datadog_agent

    from ..log import CheckLoggingAdapter, init_logging

    init_logging()
except ImportError:
    pass

Command used:

isort --check-only --diff isort_test_file.py

Output on windows:

2020-07-06T10:32:38.8847283Z ERROR: D:\a\1\s\isort_test_file.py Imports are incorrectly sorted and/or formatted.
2020-07-06T10:32:38.8848516Z --- D:\a\1\s\isort_test_file.py:before	2020-07-06 10:30:34.221084
2020-07-06T10:32:38.8850018Z +++ D:\a\1\s\isort_test_file.py:after	2020-07-06 10:32:38.883964
2020-07-06T10:32:38.8850842Z @@ -1,6 +1,7 @@
2020-07-06T10:32:38.8851503Z  try:
2020-07-06T10:32:38.8852062Z 
2020-07-06T10:32:38.8852487Z      import datadog_agent
2020-07-06T10:32:38.8852759Z 
2020-07-06T10:32:38.8853257Z  
2020-07-06T10:32:38.8853464Z 
2020-07-06T10:32:38.8854079Z +
2020-07-06T10:32:38.8854581Z      from ..log import CheckLoggingAdapter, init_logging
2020-07-06T10:32:38.8854849Z 
2020-07-06T10:32:38.8855776Z  
2020-07-06T10:32:38.8855957Z 
2020-07-06T10:32:38.8856123Z      init_logging()

Azure Pipeline CI Build link
Example Code

Python version: 3.8.3
Windows image: windows-2019

@AlexandreYang AlexandreYang changed the title New line added on windows but works fine for linux New line added on windows but works fine for linux for 5.0.3 Jul 6, 2020
@AlexandreYang
Copy link
Contributor Author

Possibly same as (or related) #1277

@timothycrosley
Copy link
Member

Thanks for reporting this bug! You were correct that it was highly related to #1277. A fix was just released in 5.0.8 with an additional regression test added.

@AlexandreYang
Copy link
Contributor Author

Awesome, thanks!

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

2 participants