Open jarekwg opened 4 years ago
Ha! That was shortlived; found a fix. Still suspicious though... I went into my iterm2 preferences, and changed cmd+click behaviour from to
I'll leave the issue open, as I wasn't having this issue with the previous python-isort atom plugin, so something fishy is still amiss if you're interested in having a look. However my problem is fixed.
Ok, this issue is back with the latest atom-isort release, and iterm settings don't seem to be getting around it.. Same error, exactly as I described it in the opening description. Opening a file with cmd+click from command line causes this extension to freak out and remain broken until atom is restarted.. Not sure what other info i can give to help debug this one..
e: in some cases error message is this instead:
I believe this error is caused by a race condition: https://github.com/lexicalunit/atom-isort/pull/30
Hmm, got excited too soon. Error still around after updating to 3.2.2. It looks like #30 has had some effect, as I no longer see the EPIPE error when the file opens, however everything else I described earlier still happens. On save, I still get: (one message per save), across all files until atom is restarted.
That error indicates that the invoked Python executable doesn't have an associated isort module.
I think it'd be useful to see if your PATH differs when Atom is opened via the command line and via cmd+click to see if different Python executables are being used.
Can you run process.env.PATH
in the Dev Tools Console (View > Developer > Toggle Developer Tools) and report the value for both methods of opening Atom?
When working: "/usr/local/opt/helm@2/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
When borked:
"/usr/bin:/bin:/usr/sbin:/sbin"
Interesting..
So my isort lives under: /Library/Frameworks/Python.framework/Versions/3.8/bin/isort
After explicitly listing isort dir in python-isort settings, i now have:
Working:
"/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/opt/helm@2/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Borked:
"/usr/bin:/bin:/usr/sbin:/sbin"
This means
atom .
in console, or just opening the application directly):
$PATH
into process.env.PATH
python-isort
config, that gets added to process.env.PATH
too.process.env.PATH
gets set/replaced to/with just "/usr/bin:/bin:/usr/sbin:/sbin"
python-isort
config, it'll be ignored.@theshoals This is smelling more like an issue with atom than with python-isort
specifically.. what do you think?
It's been an issue with Atom in the past and I thought it had been fixed, but a quick search I did just now turned this up: https://github.com/atom/atom/issues/14924 so maybe it hasn't been fixed, or it was and there's been a regression.
I don't actually use Atom anymore so if someone else wants to take over this project, let me know and I can hand it over.
It's been an issue with Atom in the past and I thought it had been fixed, but a quick search I did just now turned this up: atom/atom#14924 so maybe it hasn't been fixed, or it was and there's been a regression.
I don't actually use Atom anymore so if someone else wants to take over this project, let me know and I can hand it over.
Ah nice find. I had a look through atom issues, but didn't trawl back to 2017. There's no mention of cmd+click there, so potentially they fixed it for some cases but not others.
I've been meaning to move to vscode, but there are just some things atom does nice that make it hard to make the switch..
Anyway, thanks! will direct further info on this issue at atom/atom#14924 directly.
OK this is super weird, hear me out.
If i open my atom with
atom .
and then navigate through files using the tree view and save them, isort applies properly.However, if I bring up a file in atom by cmd+clicking it from my terminal, i get an import error as soon as the file opens. This error then reappears each time i attempt to save, as well as time i open another file, even via atom tree view. isort effectively stops working until i kill and restart my atom. Here's the error that comes up:
Using isort 5.0.7, python 3.8 Lemme know if i can provide any additional info that might help you reproduce/debug!