[Tutor] subprocess.Popen basics

Adam Jensen hanzer at riseup.net
Tue Oct 28 20:23:40 CET 2014


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
> Enterprise Linux? I can't see why that would be significantly
> different in stdin/out behaviour.
> 
> weirder and weirder

Yes, CentOS is a RHEL clone. Scientific-Linux is another RHEL clone
(assembled and maintained by several of the national labs). I'm fairly
certain that Python is in heavy use at the labs so it seems especially
weird that there is something so wonky going on with it on that
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    |
|---------------------+--------------+--------------+-----------------|
| default             | hangs        | works        | works           |
| -1                  | hangs        | works        | works           |
| 0                   | works        | works        | works           |
| 1                   | hangs        | works        | works           |
| >=2 & <(# of bytes) | works        | works        | works           |
| >=(# of bytes)      | hangs        | works        | works           |

(The number of bytes in 'Pushing up daisies.\n' is 20).

io.DEFAULT_BUFFER_SIZE == 8192 on all three platforms.


More information about the Tutor mailing list