Message137067
> 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... |
|
Date |
User |
Action |
Args |
2011-05-27 15:51:51 | neologix | set | recipients:
+ neologix, pitrou, vstinner |
2011-05-27 15:51:51 | neologix | set | messageid: <1306511511.76.0.533330116929.issue12196@psf.upfronthosting.co.za> |
2011-05-27 15:51:51 | neologix | link | issue12196 messages |
2011-05-27 15:51:51 | neologix | create | |
|