[Python-Dev] test_pty.py hangs in verbose mode on Mac OS X?
barry at python.org
Fri Apr 13 17:22:34 CEST 2007
-----BEGIN PGP SIGNED MESSAGE-----
On Apr 13, 2007, at 11:07 AM, Jean-Paul Calderone wrote:
> Likely differing buffering behavior. Prior to Linux 2.6, the pipe
> implementation allowed only a single buffer (that is, the bytes from
> a single write call) in a pipe at a time, and blocked subsequent
> writes until that buffer was read. Recently this has changed to allow
> multiple buffers up to 4k total length, so multiple short writes won't
> block anymore. OS X may have some other buffering behavior which is
> causing writes to block where they don't on Linux. All these details
> are left to the platform, and there are a variety of behaviors which
> can be considered valid.
> Of course, I don't actually /know/ the cause of the problem here, but
> this explanation seems plausible to me, and I'd investigate it before
> looking for platform-specific pty bugs (although OS X is a good
> on which to go looking for those ;).
Seems plausible to me too. If I change the child writes to > 4000
bytes, Linux w/2.6 kernel will block too.
I'm going to change the test_pty.py code to read from the master_fd.
You have to wrap the read in a try/except to catch the OSError input/
output error you'll get on Linux when you read past the end of the
buffer and the child process has already exited.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
-----END PGP SIGNATURE-----
More information about the Python-Dev