Closed withgod84 closed 7 months ago
@withgod84 We use streaming mode in the extension, so --filename
being passed in here is correct. Can you share the full log? I would like to see the settings being passed in.
I have seen exactly the same issue. And I found it is caused by the --profile black
argument which is configured in the setting isort.args
.
@yzhang-gh You will get that error if you put it in args
like this ["--profile black"]
which is wrong, it should be added like this ["--profile", "black"]
.
The space (`) between
--profileand
blackwhen you put it like
["--profile black"]causes
isort` to think this is a filename.
Amazing, it works now. I did this because the Black Formatter seems not to have this problem (with -l 120
), just like the behavior of the shell=True
in subprocess.run
.
When I try to organize import, isort does not work even for simple example and I got the following error.
According to log, giving filename option make the problem as I run the following command in terminal without "--filename", It works. python -m isort - --profile black --filename SubTest.py
I searched the error message and it seems that the extension use option 'filename' wrongly. filename option is used for streaming, not modified file. I recommend to remove "--filename" option. Please refer https://github.com/PyCQA/isort/blob/main/isort/main.py#1164