Skip to content
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

Bad escaping of settings.json on Windows #211

Open
mawildoer opened this issue Mar 7, 2024 · 1 comment
Open

Bad escaping of settings.json on Windows #211

mawildoer opened this issue Mar 7, 2024 · 1 comment

Comments

@mawildoer
Copy link
Contributor

Small thing to fix, when creating a new project, the python.defaultInterpreterPath config in settings.json isn't escaped.

When an extension tries to read or edit it, it fails because of the formatting errors.

It wants it to be "python.defaultInterpreterPath": "C:\\Users\\justi\\Documents\\ato\\venv\\Scripts\\python.exe"

image

@justind000
Copy link
Contributor

Are there any issues with naively replacing \ with \\?

"python_path": sys.executable,

"python_path": sys.executable.replace('\\', '\\\\'),

I don't think there would ever be two backslashes in a valid Windows path, so from a Windows perspective, it seems fine.
I also don't think there can be backslashes in a *nix/Max path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants