Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86213 > unrolled thread

Re: bufsize must be an integer in subprocess.Popen

Started byChris Angelico <rosuav@gmail.com>
First post2015-02-23 23:42 +1100
Last post2015-02-23 23:42 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: bufsize must be an integer in subprocess.Popen Chris Angelico <rosuav@gmail.com> - 2015-02-23 23:42 +1100

#86213 — Re: bufsize must be an integer in subprocess.Popen

FromChris Angelico <rosuav@gmail.com>
Date2015-02-23 23:42 +1100
SubjectRe: bufsize must be an integer in subprocess.Popen
Message-ID<mailman.19068.1424695363.18130.python-list@python.org>
On Mon, Feb 23, 2015 at 11:13 PM, Robert Clove <cloverobert@gmail.com> wrote:
> proc1=subprocess.Popen("/root/Desktop/abc.py","64","abc",shell=True,stdout=subprocess.PIPE,
> stderr=subprocess.PIPE)

As others have said, you need to use either a single command or a list
of strings. But why are you using shell=True here? You appear to be
invoking one single script, and not needing shell features at all.
Additionally, it seems highly likely that you're running this as root
(the /root directory is usually the root user's home dir, and is
readable by nobody else), so any sort of shell injection exploit could
easily result in an attacker getting full root access to your box. I
strongly suggest using shell=False here.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web