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.

Author reowen
Recipients
Date 2004-10-29.21:58:30
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=431773

I looked at the code and the problem is here:

        def _execute_child(self, args, executable, preexec_fn, close_fds,
                           cwd, env, universal_newlines,
                           startupinfo, creationflags, shell,
                           p2cread, p2cwrite,
                           c2pread, c2pwrite,
                           errread, errwrite):
            """Execute program (POSIX version)"""

            if isinstance(args, types.StringTypes):
                args = [args]

            if shell:
                args = ["/bin/sh", "-c"] + args

            if executable == None:
                executable = args[0]

You can se that if shell is true (as it must be if one specifies args as a string) 
and executable is supplied, one ends p with a mess, i.e. the executable ends 
up trying to execute  ["/bin/sh", "-c", args]

Fortunately cwd offers a hackaround. Still, I hope this can be either fixed or 
else can produce a warning.

While on that subject, should specifying args as a string without specifying 
shell=True should produce a warning?

Thanks for subprocess. It's a wonderful module. I am really looking forward 
to using it (once a few kinks get worked out).
History
Date User Action Args
2007-08-23 14:27:09adminlinkissue1056441 messages
2007-08-23 14:27:09admincreate