Re: [Tutor] subprocess.Popen basics

2014-10-28 Thread Adam Jensen
On 10/28/2014 04:27 PM, Todd wrote: > Centos has SELinux enabled by default. I dont know if SELinux is > causing your problem, but it is always worth looking at. > > SELinux can keep a process from accessing files or executing another > process. > > Try temporarily disabling SELinux by runnin

Re: [Tutor] subprocess.Popen basics

2014-10-28 Thread Todd
Centos has SELinux enabled by default. I dont know if SELinux is causing your problem, but it is always worth looking at. SELinux can keep a process from accessing files or executing another process. Try temporarily disabling SELinux by running setenforce=0 as root. Then see if python does wha

Re: [Tutor] subprocess.Popen basics

2014-10-28 Thread Alan Gauld
On 28/10/14 19:23, Adam Jensen wrote: platform. This is what I've discovered so far: | | CentOS-6.5 | OpenBSD-5.5 | DragonFly-3.8.2 | | bufsize | Python-3.4.1 | Python-3.3.2 | Python-3.3.3| |-+--+--+-

Re: [Tutor] subprocess.Popen basics

2014-10-28 Thread Adam Jensen
On 10/28/2014 02:32 PM, Alan Gauld wrote: > I tried -1 and 1 on my Lubuntu and it still works fine. > Definitely weird, it begins to look like a CentOS build issue > but what is CentOS doing different to Lubuntu/Suse/OpenBSD etc? > > From memory CentOS is basically a free version of Red Hat > Ent

Re: [Tutor] subprocess.Popen basics

2014-10-28 Thread Alan Gauld
On 28/10/14 15:31, Adam Jensen wrote: - bufsize will be supplied as the corresponding argument to the open() function when creating the stdin/stdout/stderr pipe file objects: And I get these results (on CentOS-6.5-x86):

Re: [Tutor] subprocess.Popen basics

2014-10-28 Thread Adam Jensen
Update: On 10/27/2014 09:50 PM, Adam Jensen wrote: > What's weird is that I have two different python3.4 installations on > this CentOS-6.5 machine and both have the same behavior (script hangs > until Ctrl+C). > > I built this one (/opt/bin/python3.4) from source: ... > But this one (~/anaconda3

Re: [Tutor] subprocess.Popen basics

2014-10-27 Thread Adam Jensen
On 10/27/2014 09:31 PM, Alan Gauld wrote: > On 27/10/14 20:26, Adam Jensen wrote: > >> That's a bit bizarre. I too have the execution bit set for both the >> python script and the shell script but the same (no joy) behavior occurs >> on both: > >> $ ./subprocess_pipe.py > > Its a long shot but

Re: [Tutor] subprocess.Popen basics

2014-10-27 Thread Alan Gauld
On 27/10/14 20:26, Adam Jensen wrote: That's a bit bizarre. I too have the execution bit set for both the python script and the shell script but the same (no joy) behavior occurs on both: $ ./subprocess_pipe.py Its a long shot but try explicitly invoking the interpreter: $ python3 ./subpro

Re: [Tutor] subprocess.Popen basics

2014-10-27 Thread Alan Gauld
On 28/10/14 01:05, Adam Jensen wrote: Thanks for giving it a try. The mailing list moderation delay is making an interactive conversation a bit difficult. Well, that much I can help with, you are now off moderation :-) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/

Re: [Tutor] subprocess.Popen basics

2014-10-27 Thread Adam Jensen
On 10/27/2014 03:40 PM, David Abbott wrote: >> It hangs at the print statement and, from the sound of the fans in the >> computer, I suspect it spirals off into an infinite loop somewhere / >> somehow. Does anyone have any ideas about what it is that I might be >> misunderstanding? > > Works here.

Re: [Tutor] subprocess.Popen basics

2014-10-27 Thread Adam Jensen
On 10/27/2014 07:12 PM, Alan Gauld wrote: > On 27/10/14 18:24, Adam Jensen wrote: >> It hangs at the print statement and, from the sound of the fans in the >> computer, I suspect it spirals off into an infinite loop somewhere > > It works fine on my Lubuntu 14 with Python3.4. > > How exactly are

Re: [Tutor] subprocess.Popen basics

2014-10-27 Thread Adam Jensen
On 10/27/2014 03:40 PM, David Abbott wrote: >> It hangs at the print statement and, from the sound of the fans in the >> computer, I suspect it spirals off into an infinite loop somewhere / >> somehow. Does anyone have any ideas about what it is that I might be >> misunderstanding? > > Works here

Re: [Tutor] subprocess.Popen basics

2014-10-27 Thread Alan Gauld
On 27/10/14 18:24, Adam Jensen wrote: It hangs at the print statement and, from the sound of the fans in the computer, I suspect it spirals off into an infinite loop somewhere It works fine on my Lubuntu 14 with Python3.4. How exactly are you running it? If I don't make parrot.sh executable I

Re: [Tutor] subprocess.Popen basics

2014-10-27 Thread David Abbott
I did do this also; david@heater ~/python_practice $ chmod a+x parrot.sh david@heater ~/python_practice $ chmod a+x subprocess_pipe.py ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/l

Re: [Tutor] subprocess.Popen basics

2014-10-27 Thread David Abbott
> It hangs at the print statement and, from the sound of the fans in the > computer, I suspect it spirals off into an infinite loop somewhere / > somehow. Does anyone have any ideas about what it is that I might be > misunderstanding? Works here. david@heater ~/python_practice $ ./subprocess_pipe

[Tutor] subprocess.Popen basics

2014-10-27 Thread Adam Jensen
Hi, I'm exploring Popen today and I seem to be having some trouble deciphering the [documentation][1]. [1]: docs.python.org/3/library/subprocess.html#popen-constructor In this example (below), I expect to start a shell script as a separate process, send a line of text through a pipe (to the shell