Skip to content

Commit

Permalink
lsp: Don't follow symlinks when expanding ${venv:<env>}
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Jan 18, 2025
1 parent b12eb76 commit e46449b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/esbonio/changes/945.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When expanding the `${venv}` config variable, the server should no longer accidentally follow symlinks back to the base Python installation
6 changes: 5 additions & 1 deletion lib/esbonio/esbonio/server/features/sphinx_manager/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import importlib.util
import logging
import os
import pathlib
import re
import sys
Expand Down Expand Up @@ -314,4 +315,7 @@ def _resolve_variable_venv(env: str, cwd: str) -> str:
return str(envpath)
else:
envpath = cwd / envpath
return str(envpath.resolve())
# Can't call envpath.resolve() here as that will also follow symlinks which we
# don't want to do
# https://github.com/swyddfa/esbonio/issues/945
return os.path.normpath(envpath)

0 comments on commit e46449b

Please sign in to comment.