[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2019-05-14 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +13245 stage: needs patch -> patch review ___ Python tracker ___ ___ Pyt

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-18 Thread R. David Murray
R. David Murray added the comment: Quote is for quoting shell special characters, not command names. It would be fairly straightforward to add that to the docs ("Return a version of the string s will with all shell special characters (including whitespace) escaped according to shell escaping

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Charles Daffern
Charles Daffern added the comment: >To be sure that it is existing program, you can use shutil.which() I'd like to clear this up a little because this is worded as if shutil.which()'s success implies that the shell will not fail. Here is the setup to demonstrate: >>> import os, shlex, shutil,

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: It's not at all obvious that the intention is to ensure such an argument should be treated only as a command external to the shell. If an application really wants to ensure the command is not handled as a shell built-in, it should use shell=False. Making

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be. But only if this doesn't make the documentation too verbose. -- assignee: -> docs@python components: +Documentation keywords: +easy nosy: +docs@python stage: -> needs patch ___ Python tracker

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Charles Daffern
Charles Daffern added the comment: In that case, should the documentation specify that shlex.quote is unsuitable for quoting command names? -- ___ Python tracker ___ ___

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This does not seem to be a serious problem. In any case the command is failed. And usually argv[0] is predefined command name, not arbitrary user input. To be sure that it is existing program, you can use shutil.which(). I would close this issue as "won't fi

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Charles Daffern
Charles Daffern added the comment: It's definitely a corner case (in argv[0] position + is keyword), but here's an example: >>> import subprocess >>> import shlex >>> subprocess.call(shlex.quote("done"), shell=True) /bin/sh: 1: Syntax error: "done" unexpected 2 The expected output of this woul

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please provide an example? -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread SilentGhost
Changes by SilentGhost : -- components: +Library (Lib) -Extension Modules nosy: +eric.araujo versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker ___

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Charles Daffern
New submission from Charles Daffern: The shlex.quote and pipes.quote functions do not quote shell keywords. Example shell keywords: done, time, coproc, while Presumably the intent of the quote functions is to prevent the resulting string from altering the syntax of the script it is inserted in