Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Windows command line does not support single quotes.#91856

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
BruceLee569 wants to merge2 commits intopython:mainfromBruceLee569:patch-2

Conversation

@BruceLee569
Copy link
Contributor

@BruceLee569BruceLee569 commentedApr 23, 2022
edited
Loading

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

System version: Windows 10 21H2Python version: Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32At 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:![demo](https://gifyu.com/image/SLtLK)
@ghost
Copy link

ghost commentedApr 23, 2022
edited by ghost
Loading

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@bedevere-botbedevere-bot added docsDocumentation in the Doc dir awaiting review labelsApr 23, 2022
@fatihkabakk
Copy link
Contributor

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

Yes, you're correct. However, powershell does not require double quotes. Powershell is like a simulation ofcmd andsh together. To explain in detail,cmd requires every space-including parameter to be encolsed in double quotes. Also, seeThe Developer Guide.

@JelleZijlstra
Copy link
Member

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.

@zooba
Copy link
Member

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.

JelleZijlstra and fatihkabakk reacted with thumbs up emoji

@JelleZijlstraJelleZijlstra self-assigned thisOct 5, 2022
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull requestOct 12, 2022
Closespython#91856.On Windows double quotes are sometimes better, on Unix usuallysingle quotes. It's not our place to explain that, so just don't.
@JelleZijlstra
Copy link
Member

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.)

JelleZijlstra added a commit that referenced this pull requestOct 12, 2022
Closes#91856.On Windows double quotes are sometimes better, on Unix usuallysingle quotes. It's not our place to explain that, so just don't.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 12, 2022
ClosespythonGH-91856.On Windows double quotes are sometimes better, on Unix usuallysingle quotes. It's not our place to explain that, so just don't.(cherry picked from commit5f8ca1b)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 12, 2022
ClosespythonGH-91856.On Windows double quotes are sometimes better, on Unix usuallysingle quotes. It's not our place to explain that, so just don't.(cherry picked from commit5f8ca1b)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
miss-islington added a commit that referenced this pull requestOct 12, 2022
ClosesGH-91856.On Windows double quotes are sometimes better, on Unix usuallysingle quotes. It's not our place to explain that, so just don't.(cherry picked from commit5f8ca1b)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
miss-islington added a commit that referenced this pull requestOct 12, 2022
ClosesGH-91856.On Windows double quotes are sometimes better, on Unix usuallysingle quotes. It's not our place to explain that, so just don't.(cherry picked from commit5f8ca1b)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
pablogsal pushed a commit that referenced this pull requestOct 22, 2022
ClosesGH-91856.On Windows double quotes are sometimes better, on Unix usuallysingle quotes. It's not our place to explain that, so just don't.(cherry picked from commit5f8ca1b)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra left review comments

@zoobazoobaAwaiting requested review from zooba

Assignees

@JelleZijlstraJelleZijlstra

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@BruceLee569@fatihkabakk@JelleZijlstra@zooba@bedevere-bot@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp