-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
Windows command line does not support single quotes. #91856
Conversation
System version: Windows 10 21H2 Python version: Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32 At the command-line terminal (cmd or Powershell) you have to use double quotes to enclose the argument you wish to send. Enclose it with double quotes, and use single quotes within it. (https://stackoverflow.com/a/34379661/11687405) For details, please refer to the GIF:
The following commit authors need to sign the Contributor License Agreement: |
Yes, you're correct. However, powershell does not require double quotes. Powershell is like a simulation of |
On Unix, single quotes are better because double quotes may do variable substitution. I'm not familiar enough with Windows to opine on what quotes are better there. |
Maybe just say "single or double quotes"? This is a hint for people who are both new to terminals and new to Python, but it isn't really our responsibility to go too deep into how to use every single terminal in the world. In general, Windows and cmd don't care about quotes, but the apps themselves do the splitting and might care. PowerShell expands variables within double quotes, but not within single quotes, but it's hard to say which may be preferred in any given case. So basically, "it's complicated," and we should probably just avoid having too strong an opinion. |
Closes python#91856. On Windows double quotes are sometimes better, on Unix usually single quotes. It's not our place to explain that, so just don't.
Opened #98204 because of the CLA issues on this one. (The change we ended up with is distinct enough from @BruceLee569's original change that I don't think there's an issue with the new PR.) |
Closes #91856. On Windows double quotes are sometimes better, on Unix usually single quotes. It's not our place to explain that, so just don't.
Closes pythonGH-91856. On Windows double quotes are sometimes better, on Unix usually single quotes. It's not our place to explain that, so just don't. (cherry picked from commit 5f8ca1b) Co-authored-by: Jelle Zijlstra <[email protected]>
Closes pythonGH-91856. On Windows double quotes are sometimes better, on Unix usually single quotes. It's not our place to explain that, so just don't. (cherry picked from commit 5f8ca1b) Co-authored-by: Jelle Zijlstra <[email protected]>
Closes GH-91856. On Windows double quotes are sometimes better, on Unix usually single quotes. It's not our place to explain that, so just don't. (cherry picked from commit 5f8ca1b) Co-authored-by: Jelle Zijlstra <[email protected]>
Closes GH-91856. On Windows double quotes are sometimes better, on Unix usually single quotes. It's not our place to explain that, so just don't. (cherry picked from commit 5f8ca1b) Co-authored-by: Jelle Zijlstra <[email protected]>
Closes GH-91856. On Windows double quotes are sometimes better, on Unix usually single quotes. It's not our place to explain that, so just don't. (cherry picked from commit 5f8ca1b) Co-authored-by: Jelle Zijlstra <[email protected]>
System version: Windows 10 21H2
Python version: Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
At the command-line terminal (cmd or Powershell) you have to use double quotes to enclose the argument you wish to send. Enclose it with double quotes, and use single quotes within it. (https://stackoverflow.com/a/34379661/11687405)
For details, please refer to the GIF:https://gifyu.com/image/SLtLK