You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If running type file.py | isort - --diff on Windows there is often no output given, even if there is sorting to do. This affects at least the VSCode integration and possibly other IDE integrations.
I actually think this is a Python bug (reported as https://bugs.python.org/issue40540), however there may be something which isort can do to work around it.
Currently isort looks for a coding comment in the input source and thus seeks within the input file having done that. Unfortunately that seems to cause issues on Windows, where further reads from stdin return no data.
For microsoft/vscode-python#9128 we're working around this by replacing stdin with an io.BytesIO so that isort can reliably seek within that stream. Obviously this isn't great and while it's not isort's fault (and this likely affects other tools too), one option would be for isort itself to use this io.BytesIO trick (or an equivalent fix) so that individual integrations don't need to patch around it.
I realise that the main focus of development now appears to be on 5.x, however would you be open to a patch against the 4.x stream which fixed this issue there?
The text was updated successfully, but these errors were encountered:
If running
type file.py | isort - --diff
on Windows there is often no output given, even if there is sorting to do. This affects at least the VSCode integration and possibly other IDE integrations.I actually think this is a Python bug (reported as https://bugs.python.org/issue40540), however there may be something which
isort
can do to work around it.Currently
isort
looks for a coding comment in the input source and thus seeks within the input file having done that. Unfortunately that seems to cause issues on Windows, where further reads fromstdin
return no data.For microsoft/vscode-python#9128 we're working around this by replacing
stdin
with anio.BytesIO
so thatisort
can reliably seek within that stream. Obviously this isn't great and while it's notisort
's fault (and this likely affects other tools too), one option would be forisort
itself to use thisio.BytesIO
trick (or an equivalent fix) so that individual integrations don't need to patch around it.I realise that the main focus of development now appears to be on 5.x, however would you be open to a patch against the 4.x stream which fixed this issue there?
The text was updated successfully, but these errors were encountered: