Re: .write() behavior

2014-10-31 Thread Alan Bawden
Marko Rauhamaa writes: > Let me mention a related problem I ran into a couple of weeks ago. > Linux's standard C library (glibc) implements fread(3) differently in > RHEL 5 and RHEL 6/7. In RHEL 5, it blocks in a loop until it has read in > the desired number of records. In RHEL 6 and 7, it appea

Re: .write() behavior

2014-10-28 Thread Marko Rauhamaa
Alan Bawden : > You might be right, because nothing in the Python 2 documentation I > can find _explicitly_ says that file.write() is guaranteed to write > everything I told it to, but that seems like a sufficiently surprising > fact that I would expect the documentation to emphasize the danger.

.write() behavior

2014-10-28 Thread Alan Bawden
Marko Rauhamaa writes: > Marko Rauhamaa : > Actually, that's mistaken as well. The sys.std* handles and pipes > returned by subprocess are accessed using file.write() and thus may > return partial writes. I find this very surprising. In Python 2, where file.write() seems to always return None,