Re: subprocess module usage

2014-09-01 Thread Earl Lapus
On Mon, Sep 1, 2014 at 1:39 PM, Chris Angelico ros...@gmail.com wrote: Glad it's working! But please, don't just take my word for it and make a black-box change to your code. When you invoke subprocesses, be sure you understand what's going on, and when shell=True is appropriate and when

Re: subprocess module usage

2014-09-01 Thread Cameron Simpson
On 01Sep2014 14:33, Earl Lapus earl.la...@gmail.com wrote: On Mon, Sep 1, 2014 at 1:39 PM, Chris Angelico ros...@gmail.com wrote: Glad it's working! But please, don't just take my word for it and make a black-box change to your code. When you invoke subprocesses, be sure you understand what's

Re: subprocess module usage

2014-09-01 Thread Chris Angelico
On Mon, Sep 1, 2014 at 6:46 PM, Cameron Simpson c...@zip.com.au wrote: Not really. If the arguments are coming in from the command line, someone (a user, even if that user is the programmer) typed them. Even if not malicious, they can still be mistaken. Or just unfortunate. I'm guessing that

Re: subprocess module usage

2014-09-01 Thread Akira Li
Earl Lapus earl.la...@gmail.com writes: Hi, I made simple test program using the subprocess module (see attached: exec_cmd.py). I ran it passing variations of 'ls' command options. I encounter exceptions every time I use '-l' options. Example runs where exception occurs: # ./exec_cmd.py

subprocess module usage

2014-08-31 Thread Earl Lapus
Hi, I made simple test program using the subprocess module (see attached: exec_cmd.py). I ran it passing variations of 'ls' command options. I encounter exceptions every time I use '-l' options. Example runs where exception occurs: # ./exec_cmd.py ls -al # ./exec_cmd.py ls -l However, if I pass

Re: subprocess module usage

2014-08-31 Thread Chris Angelico
On Mon, Sep 1, 2014 at 1:28 PM, Earl Lapus earl.la...@gmail.com wrote: So, what could be causing this behavior? Is this expected or is there something wrong with how I'm using the subprocess module? The latter. Your problem is with your shell= option. Firstly, the parameter should be either

Re: subprocess module usage

2014-08-31 Thread Chris Angelico
On Mon, Sep 1, 2014 at 3:24 PM, Earl Lapus earl.la...@gmail.com wrote: On Mon, Sep 1, 2014 at 11:55 AM, Chris Angelico ros...@gmail.com wrote: But secondly, you're already splitting the argument (or rather, taking it from your own parameters, already split), so you don't want to go through

Re: subprocess module usage

2014-08-31 Thread Earl Lapus
On Mon, Sep 1, 2014 at 11:55 AM, Chris Angelico ros...@gmail.com wrote: But secondly, you're already splitting the argument (or rather, taking it from your own parameters, already split), so you don't want to go through the shell. In fact, going through the shell would only make your life

[issue3235] Improve subprocess module usage

2008-07-02 Thread Martin Mokrejs
Martin Mokrejs [EMAIL PROTECTED] added the comment: Georg, but would you please improve the docs explaining what communicate really does? The syntax is nice but I don't see how can I use poll() described in the same above to use that. Providing Examples section would be the best. Of course I

[issue3235] Improve subprocess module usage

2008-06-29 Thread Martin Mokrejs
. -- assignee: georg.brandl components: Documentation messages: 68943 nosy: georg.brandl, mmokrejs severity: normal status: open title: Improve subprocess module usage type: resource usage versions: Python 2.5 ___ Python tracker [EMAIL PROTECTED] http

[issue3235] Improve subprocess module usage

2008-06-29 Thread Martin Mokrejs
Martin Mokrejs [EMAIL PROTECTED] added the comment: Please link to http://www.python.org/dev/peps/pep-0324/ from the docs webpage at least. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3235 ___

[issue3235] Improve subprocess module usage

2008-06-29 Thread David
David [EMAIL PROTECTED] added the comment: See if Doug Hellman's module of the week helps any http://blog.doughellmann.com/2007/07/pymotw-subprocess.html I plan on asking him if we can include some of his examples in the Python 3000 docs. Subprocess is new enough and gets enough questions on

[issue3235] Improve subprocess module usage

2008-06-29 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: 1. The documentation never gives a rationale for deprecating things. To find out why they are deprecated, you'll typically have to research what checkins to a code base have been made that added the deprecation, and perhaps also ask on mailing