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

Unable to identify Python executable from path due to apostrophe #24265

Open
jacobopt opened this issue Oct 7, 2024 Discussed in #24264 · 1 comment
Open

Unable to identify Python executable from path due to apostrophe #24265

jacobopt opened this issue Oct 7, 2024 Discussed in #24264 · 1 comment
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug needs spike Label for issues that need investigation before they can be worked on.

Comments

@jacobopt
Copy link

jacobopt commented Oct 7, 2024

Discussed in #24264

Originally posted by jacobopt October 7, 2024
Hello,

Posting to Github because I was directed here from Stack Overflow!

I have a user who is not able to get VSCode to recognise the Python executable from the Python path. We have set the default interpreter path to be the path of the executable in the extension settings, but it's still not working. We suspect the issue is to do with an apostrophe in the path, due to the name of the user containing an apostrophe.

The path of the executable is this: C:/Users/BobO'Ross/AppData/Local/Programs/Python/Python312/python.exe

and the error message we get after trying to run a Python program is this: The term C:/Users/BobORoss/AppData/Local/Programs/Python/Python312/python.exe c:/Users/BobORoss/Documents/test1.py' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

As you can see, the error message removes the apostrophe from the directory. It probably does this because it sees the apostrophe as a special letter. We have tried escaping the apostrophe in various ways e.g. by adding a backslash and a ` (whatever that character is called), but none of these seem to work.

We're not really sure what else to do.

Thank you in advance for your help.

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 7, 2024
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Oct 8, 2024
@karthiknadig karthiknadig self-assigned this Oct 8, 2024
@karthiknadig
Copy link
Member

This looks like a bug in the shell escaping.

@Tyriar This is something that we often run into where sendText fallback also fails because we don't know shell type or we can't do shell escaping correctly.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 8, 2024
@karthiknadig karthiknadig added area-terminal needs spike Label for issues that need investigation before they can be worked on. and removed info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team labels Oct 8, 2024
@karthiknadig karthiknadig removed their assignment Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug needs spike Label for issues that need investigation before they can be worked on.
Projects
None yet
Development

No branches or pull requests

2 participants