This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年03月16日 16:32 by tim.golden, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| subprocess-r61420.patch | tim.golden, 2008年03月16日 16:32 | Patch against r61240 of Python trunk | ||
| subprocess-r61514.patch | tim.golden, 2008年03月18日 10:37 | Patch against r61514 of Python trunk | ||
| subprocess.diff | ggenellina, 2009年11月15日 10:46 | Updated patch r76294 | ||
| Messages (11) | |||
|---|---|---|---|
| msg63583 - (view) | Author: Tim Golden (tim.golden) * (Python committer) | Date: 2008年03月16日 16:32 | |
The subprocess.Popen function reorganises the command line for process creation when shell=True is passed in under Windows. It runs the existing executable & arguments as arguments to %COMSPEC% /c. However this fails when a second parameter (typically a filename) has an embedded space. The patch attached adds extra parameters in this case and adds appropriate unit tests. Frankly I'm new to unittests and I more-or-less cloned an existing one to make this work. Happy to be corrected if there's things done wrong &c. |
|||
| msg63610 - (view) | Author: Gabriel Genellina (ggenellina) | Date: 2008年03月17日 00:59 | |
You aren't testing the modified code, the Popen call should say shell=True. I think that a more PEP8-compliant style would be nice (removing the spaces after open and read, and using consistent indentation) |
|||
| msg63623 - (view) | Author: Tim Golden (tim.golden) * (Python committer) | Date: 2008年03月17日 08:08 | |
Gabriel Genellina wrote: > Gabriel Genellina <gagsl-py2@yahoo.com.ar> added the comment: > > You aren't testing the modified code, the Popen call should say > shell=True. > > I think that a more PEP8-compliant style would be nice (removing the > spaces after open and read, and using consistent indentation) D'oh. Thanks, Gabriel. I'll rework the test and tidy up the patch. |
|||
| msg63907 - (view) | Author: Tim Golden (tim.golden) * (Python committer) | Date: 2008年03月18日 10:37 | |
Updated patch against r61514. Test code now PEP8-compliant (I hope). New tests cover spaces in command and parameter with and without shell=True, both as simple command string and as list of command/args. |
|||
| msg95284 - (view) | Author: Gabriel Genellina (ggenellina) | Date: 2009年11月15日 10:46 | |
An up-to-date patch; same contents, but this one can be cleanly applied to trunk (as of r76294) |
|||
| msg95328 - (view) | Author: David Fraser (davidfraser) | Date: 2009年11月16日 08:44 | |
This is closely related to http://bugs.python.org/issue6689 |
|||
| msg111352 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010年07月23日 16:05 | |
@Tim: @Gabriel: test_subprocess has changed a lot since the patch was done. If one of you could provide a new patch for 2.7 and py3k I'll test it, thanks. |
|||
| msg113279 - (view) | Author: Tim Golden (tim.golden) * (Python committer) | Date: 2010年08月08日 16:21 | |
Committed as r83830, r83831, r83832 |
|||
| msg113299 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2010年08月08日 19:09 | |
Reverted because of test-breakage on unixes. |
|||
| msg113674 - (view) | Author: Tim Golden (tim.golden) * (Python committer) | Date: 2010年08月12日 12:35 | |
ReComitted as r83947, r83956, r83957 and this time the buildbots look happy. (At least as regards this change). |
|||
| msg120727 - (view) | Author: Weeble (weeble) | Date: 2010年11月08日 10:58 | |
Is there any way to write code that's safe with or without this fix? If I have code that currently does this:
subprocess.check_call('""c:\some path with spaces" arg1 arg2 "a quoted arg""', shell=True)
...will it break when running on a version of Python with this fix? Is there any good way to detect whether the running Python has this fix or not?
|
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:31 | admin | set | github: 46557 |
| 2010年11月08日 10:58:28 | weeble | set | nosy:
+ weeble messages: + msg120727 |
| 2010年08月12日 12:35:49 | tim.golden | set | status: open -> closed resolution: fixed messages: + msg113674 |
| 2010年08月08日 19:09:53 | benjamin.peterson | set | status: closed -> open nosy: + benjamin.peterson messages: + msg113299 resolution: fixed -> (no value) |
| 2010年08月08日 16:21:35 | tim.golden | set | status: open -> closed resolution: fixed messages: + msg113279 stage: patch review -> resolved |
| 2010年08月06日 15:45:31 | tim.golden | set | assignee: tim.golden components: + Windows nosy: davidfraser, ggenellina, dstanek, tim.golden, BreamoreBoy |
| 2010年07月31日 17:40:45 | dstanek | set | nosy:
+ dstanek |
| 2010年07月23日 16:05:20 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg111352 versions: - Python 2.6 |
| 2009年11月16日 08:44:30 | davidfraser | set | messages: + msg95328 |
| 2009年11月15日 10:46:54 | ggenellina | set | files:
+ subprocess.diff messages: + msg95284 versions: + Python 3.1, Python 2.7, Python 3.2 |
| 2009年08月12日 07:33:27 | davidfraser | set | nosy:
+ davidfraser |
| 2009年04月07日 23:13:40 | tleeuwenburg@gmail.com | set | stage: patch review |
| 2008年03月18日 10:37:19 | tim.golden | set | files:
+ subprocess-r61514.patch messages: + msg63907 |
| 2008年03月17日 08:08:41 | tim.golden | set | messages:
+ msg63623 title: subprocess under windows fails to quote properly when shell=True -> subprocess under windows fails to quote properly when shell=True |
| 2008年03月17日 00:59:31 | ggenellina | set | nosy:
+ ggenellina messages: + msg63610 |
| 2008年03月16日 16:36:27 | tim.golden | set | title: subprocess under windows fails to quote properly under Windows when shell=True -> subprocess under windows fails to quote properly when shell=True |
| 2008年03月16日 16:32:18 | tim.golden | create | |