-
Notifications
You must be signed in to change notification settings - Fork 51
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
better error message for conda config json parsing? #163
Labels
Comments
2 tasks
necaris
added a commit
that referenced
this issue
Oct 5, 2024
Fixes #163. Discards the standard error from the `conda` command, ensuring that it _should_ be more consistently parseable as JSON.
necaris
added a commit
that referenced
this issue
Oct 5, 2024
Fixes #163. Discards the standard error from the `conda` command, ensuring that it _should_ be more consistently parseable as JSON.
the new version ignores the non-json header, and so yes it works on my system. thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! thanks for maintaining conda.el which I find useful!
I tried installing it on a new windows computer, with a fresh miniconda install today.
First I configuring the path to my conda install in .emacs as usual via:
Then usually M-x conda-env-activate works fine.
This time I got an error, something like invalid stringp (forget exact wording), in the minibuffer.
I used edebug to figure out the root issue. Call stack is ...
which has
(json-read-from-string output)
in which output had some FutureWarning text as below (non-JSON data). You can simulate the issue via the code below which has the data on my system that was causing the errorThe work-around that I used was to read the warning, and use the conda config commands that were suggested, until the warnings went away, and conda config returns just JSON data as below (no warnings)
It would be great if conda.el could give the user a better error message in the minibuffer, something like "json-read-from-string failed, please run conda config --show --json in the anaconda shell, and read the warnings, and act to suppress them"
another fix would be to change the conda command line program to emit these warning in stderr instead of stdout, which I think would fix the "parsing failed issue" do you agree? if so I will file an issue in https://github.com/conda/conda/issues
but it still would be good to get a better error message, please.
also inside of conda--call-json I saw this let binding
(fmt (format "shell.%s+json" (if (eq system-type 'windows-nt) "cmd.exe" "posix")))
but fmt is not used after that, so I wonder if it could be deleted?The text was updated successfully, but these errors were encountered: