This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients neologix, pitrou, vstinner
Date 2011-05-27.15:51:50
SpamBayes Score 4.32987e-15
Marked as misclassified No
Message-id <1306511511.76.0.533330116929.issue12196@psf.upfronthosting.co.za>
In-reply-to
Content
> Do you want to call the function with two arguments or one tuple with 2 items? You may test both :-)

The former. Fixed.

> Hum, I'm not sure that it's revelant to test the time

I didn't like it either, I just reused what's done in test_socket. Fixed.

> BaseTestCase.test_communicate_pipe_buf() on subprocess uses

Yeah, except that it doesn't work, POSIX's PIPE_BUF is the guaranteed limit for the write to be atomic, not the buffer size (furthermore the libc doesn't have any way to know the pipe's buffer size or max atomic write, it's just a defined constant).

$ cat /tmp/test_pipe.py 
import os

r, w = os.pipe()
max = os.fpathconf(w, 'PC_PIPE_BUF')
print(max)
os.write(w, 2 * max * b'x')
print('ok')

$ ./python /tmp/test_pipe.py 
4096
ok

> This constant should be moved to test.support.

Patch attached.
It uses a constant of 1MB, even on Windows. I hope it won't break there, you never know with Windows...
History
Date User Action Args
2011-05-27 15:51:51neologixsetrecipients: + neologix, pitrou, vstinner
2011-05-27 15:51:51neologixsetmessageid: <1306511511.76.0.533330116929.issue12196@psf.upfronthosting.co.za>
2011-05-27 15:51:51neologixlinkissue12196 messages
2011-05-27 15:51:51neologixcreate