GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Windows command line does not support single quotes. by BruceLee569 · Pull Request #91856 · python/cpython

Conversation

@BruceLee569

@BruceLee569 BruceLee569 commented Apr 23, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@BruceLee569
Windows command line does not support single quotes.
befb472
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:![demo](https://gifyu.com/image/SLtLK)
@ghost

ghost commented Apr 23, 2022 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

  • [email protected]

Click the button to sign:
CLA not signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Apr 23, 2022
@fatihkabakk

fatihkabakk commented Apr 23, 2022

Copy link
Copy Markdown
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 of cmd and sh together. To explain in detail, cmd requires every space-including parameter to be encolsed in double quotes. Also, see The Developer Guide.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra

JelleZijlstra commented Apr 30, 2022

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood AlexWaygood added skip issue skip news labels May 2, 2022
@AlexWaygood
AlexWaygood requested a review from zooba May 2, 2022 17:22
@zooba

zooba commented May 2, 2022

Copy link
Copy Markdown
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
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra
JelleZijlstra reviewed May 2, 2022
View reviewed changes
Comment thread Doc/tutorial/interpreter.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood AlexWaygood added the OS-windows label May 4, 2022
@JelleZijlstra
Update Doc/tutorial/interpreter.rst
24aff3a
@JelleZijlstra JelleZijlstra self-assigned this Oct 5, 2022
@JelleZijlstra JelleZijlstra mentioned this pull request Oct 12, 2022
tutorial: remove "with single quotes" #98204
Merged
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request Oct 12, 2022
@JelleZijlstra
tutorial: remove "with single quotes"
0bc678f
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.
@JelleZijlstra

JelleZijlstra commented Oct 12, 2022

Copy link
Copy Markdown
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.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra JelleZijlstra closed this in #98204 Oct 12, 2022
JelleZijlstra added a commit that referenced this pull request Oct 12, 2022
@JelleZijlstra
tutorial: remove "with single quotes" (#98204)
5f8ca1b
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.
This was referenced Oct 12, 2022
[3.10] tutorial: remove "with single quotes" (GH-98204) #98222
Merged
[3.11] tutorial: remove "with single quotes" (GH-98204) #98223
Merged
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 12, 2022
@JelleZijlstra @miss-islington
tutorial: remove "with single quotes" (pythonGH-98204)
7f2aee7
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]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 12, 2022
@JelleZijlstra @miss-islington
tutorial: remove "with single quotes" (pythonGH-98204)
b4f9218
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]>
miss-islington added a commit that referenced this pull request Oct 12, 2022
@miss-islington @JelleZijlstra
tutorial: remove "with single quotes" (GH-98204)
2ed28a6
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]>
miss-islington added a commit that referenced this pull request Oct 12, 2022
@miss-islington @JelleZijlstra
tutorial: remove "with single quotes" (GH-98204)
b2f037c
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]>
pablogsal pushed a commit that referenced this pull request Oct 22, 2022
@miss-islington @JelleZijlstra @pablogsal
tutorial: remove "with single quotes" (GH-98204)
b636023
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra left review comments
@zooba zooba Awaiting requested review from zooba

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@JelleZijlstra JelleZijlstra

Labels

awaiting review docs Documentation in the Doc dir OS-windows skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@BruceLee569 @fatihkabakk @JelleZijlstra @zooba @bedevere-bot @AlexWaygood
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.