[issue12196] add pipe2() to the os module

2011-06-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset ba975c7c33d3 by Charles-François Natali in branch 'default': Issue #12196: Make os.pipe2() flags argument mandatory. http://hg.python.org/cpython/rev/ba975c7c33d3 -- ___ Python tracker

[issue12196] add pipe2() to the os module

2011-06-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Hmm, thinking about it, I don't see any reason to make the flags argument > optional. > Here's a patch changing that (also, pipe2 is now declared as METH_O instead > of METH_VARARGS). Looks good to me. -- ___ Py

[issue12196] add pipe2() to the os module

2011-06-06 Thread Charles-François Natali
Charles-François Natali added the comment: Hmm, thinking about it, I don't see any reason to make the flags argument optional. Here's a patch changing that (also, pipe2 is now declared as METH_O instead of METH_VARARGS). -- Added file: http://bugs.python.org/file22265/pipe2_arg.diff

[issue12196] add pipe2() to the os module

2011-06-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 277bbe6cae53 by Charles-François Natali in branch 'default': Issue #12196: Make test.support's requires_linux_version a decorator. http://hg.python.org/cpython/rev/277bbe6cae53 -- ___ Python tracker

[issue12196] add pipe2() to the os module

2011-06-01 Thread STINNER Victor
STINNER Victor added the comment: Your last support_linux_version.diff patch looks good. If you are motivated, this new function can also be added to test.support of Python 3.2 (test_socket.py has the original linux_version() function). -- ___ Pyth

[issue12196] add pipe2() to the os module

2011-06-01 Thread Charles-François Natali
Charles-François Natali added the comment: > requires_linux_version() should also be a decorator. Patch attached. -- Added file: http://bugs.python.org/file22219/support_linux_version.diff ___ Python tracker ___

[issue12196] add pipe2() to the os module

2011-06-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4124d1f75b93 by Charles-François Natali in branch 'default': Issue #12196: Add a note on os.pipe2() in the "Whats' new in Python 3.3" http://hg.python.org/cpython/rev/4124d1f75b93 -- ___ Python tracker

[issue12196] add pipe2() to the os module

2011-06-01 Thread STINNER Victor
STINNER Victor added the comment: > support_linux_version.diff: cool, it's even better than the previous patch. > You can commit it, except if you are motived for a last change: display > the write also version in the SkipTest message (as it is done actually). I just added a very similar functi

[issue12196] add pipe2() to the os module

2011-05-31 Thread STINNER Victor
STINNER Victor added the comment: support_linux_version.diff: cool, it's even better than the previous patch. You can commit it, except if you are motived for a last change: display the write also version in the SkipTest message (as it is done actually). pipe2_whatsnew.diff: I don't have any

[issue12196] add pipe2() to the os module

2011-05-31 Thread Charles-François Natali
Charles-François Natali added the comment: > I like your patch, it removes many duplicate code :-) > > Some comments: Patch attached. > Doc/whatsnew/3.3.rst Patch attached. -- Added file: http://bugs.python.org/file22209/pipe2_whatsnew.diff Added file: http://bugs.python.org/file222

[issue12196] add pipe2() to the os module

2011-05-30 Thread STINNER Victor
STINNER Victor added the comment: > See the patch attached. I like your patch, it removes many duplicate code :-) Some comments: - I don't like an if surrounding the whole function, I prefer "if not ...: return" to avoid the (useless) indentation. Well, it's my coding style, do as you want.

[issue12196] add pipe2() to the os module

2011-05-30 Thread Charles-François Natali
Charles-François Natali added the comment: > support.linux_version() may be changed for requires_linux_version(2, 6, 27), > > but linux_version() is always used in tests to check the Linux version. > requires_linux_version() would only raise a SkipTest if the OS is Linux and > if > the kernel i

[issue12196] add pipe2() to the os module

2011-05-29 Thread R. David Murray
R. David Murray added the comment: FYI that buildbot is likely to get a kernel upgrade in the not too distant future. -- ___ Python tracker ___

[issue12196] add pipe2() to the os module

2011-05-29 Thread STINNER Victor
STINNER Victor added the comment: > If've added a test to skip this test on Linux kernels older than 2.6.27: > like O_CLOEXEC, the problem is that the libc defines pipe2() while the > kernel doesn't support it, so when syscall() is called it bails out with > ENOSYS. (This buildbot should really

[issue12196] add pipe2() to the os module

2011-05-29 Thread Charles-François Natali
Charles-François Natali added the comment: The test now runs fine on the buildbots, closing. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue12196] add pipe2() to the os module

2011-05-29 Thread Charles-François Natali
Charles-François Natali added the comment: The Gentoo buildbot on which O_CLOEXEC test failed also chokes on test_pipe2: [ 10/355] test_posix test test_posix failed -- Traceback (most recent call last): File "/var/lib/buildslave/3.x.murray-gentoo-wide/build/Lib/test/test_posix.py", line 487

[issue12196] add pipe2() to the os module

2011-05-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 293c398cd4cf by Charles-François Natali in branch 'default': Issue #12196: Add pipe2() to the os module. http://hg.python.org/cpython/rev/293c398cd4cf -- ___ Python tracker

[issue12196] add pipe2() to the os module

2011-05-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 866d959dea8e by Charles-François Natali in branch 'default': Issue #12196: Add PIPE_MAX_SIZE to test.support, constant larger than the http://hg.python.org/cpython/rev/866d959dea8e -- nosy: +python-dev _

[issue12196] add pipe2() to the os module

2011-05-28 Thread R. David Murray
R. David Murray added the comment: For the record (for people reading this ticket later), the removal of the python version of the unix subprocess code was discussed on IRC, and it was clarified there that the reason for removing it is not that it duplicates the C code. We like having python

[issue12196] add pipe2() to the os module

2011-05-28 Thread Gregory P. Smith
Gregory P. Smith added the comment: Include an appropriate Version Added annotation in the pipe2 documentation. Otherwise the current patches look good to me. -- ___ Python tracker ___

[issue12196] add pipe2() to the os module

2011-05-28 Thread Charles-François Natali
Charles-François Natali added the comment: > I just nuked the pure Python POSIX subprocess implementation Nice. I've updated both patches to address Victor's comments on test_io and test_subprocess usage of PIPE_MAX_SIZE, and Ross' comment on pipe2's configure tests. I left subprocess use _po

[issue12196] add pipe2() to the os module

2011-05-28 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file22151/support_pipe_max.diff ___ Python tracker ___ ___ Python-bu

[issue12196] add pipe2() to the os module

2011-05-28 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file22154/posix_pipe2.diff ___ Python tracker ___ ___ Python-bugs-li

[issue12196] add pipe2() to the os module

2011-05-28 Thread Gregory P. Smith
Gregory P. Smith added the comment: I just nuked the pure Python POSIX subprocess implementation in 70467:75ca834df824. No need for both implementations. _posixsubprocess is now the only option. -- ___ Python tracker

[issue12196] add pipe2() to the os module

2011-05-28 Thread Ross Lagerwall
Ross Lagerwall added the comment: >> Also, the pure python implementation of subprocess for posix can now >> be >> updated to use pipe2 if it exists (previously on _posixsubprocess.c >> used it). > I don't understand the last part :-) > What do you suggest? Perhaps, os.pipe2 can be used if av

[issue12196] add pipe2() to the os module

2011-05-28 Thread Charles-François Natali
Changes by Charles-François Natali : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12196] add pipe2() to the os module

2011-05-28 Thread Charles-François Natali
Charles-François Natali added the comment: > Out of interest, is there any reason that the configure check for pipe2 is a > special case near the bottom of configure.in instead of with all the other > function checks in the AC_CHECK_FUNCS[] section in the middle? No clue. I'll fix that. > Al

[issue12196] add pipe2() to the os module

2011-05-28 Thread Ross Lagerwall
Ross Lagerwall added the comment: Out of interest, is there any reason that the configure check for pipe2 is a special case near the bottom of configure.in instead of with all the other function checks in the AC_CHECK_FUNCS[] section in the middle? I know this patch didn't write the configure

[issue12196] add pipe2() to the os module

2011-05-27 Thread Charles-François Natali
Charles-François Natali added the comment: > +# A constant likely larger than the underlying OS pipe buffer size. > +# Windows limit seems to be around 512B, and most Unix kernels have a 64K > pipe > +# buffer size: take 1MB to be sure. > +PIPE_MAX_SIZE = 1024 * 1024 > > Hum, I am not sure that

[issue12196] add pipe2() to the os module

2011-05-27 Thread Charles-François Natali
Changes by Charles-François Natali : Added file: http://bugs.python.org/file22154/posix_pipe2.diff ___ Python tracker ___ ___ Python-bugs-list

[issue12196] add pipe2() to the os module

2011-05-27 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file22152/posix_pipe2.diff ___ Python tracker ___ ___ Python-bugs-li

[issue12196] add pipe2() to the os module

2011-05-27 Thread STINNER Victor
STINNER Victor added the comment: +# A constant likely larger than the underlying OS pipe buffer size. +# Windows limit seems to be around 512B, and most Unix kernels have a 64K pipe +# buffer size: take 1MB to be sure. +PIPE_MAX_SIZE = 1024 * 1024 Hum, I am not sure that the comment is correct

[issue12196] add pipe2() to the os module

2011-05-27 Thread Charles-François Natali
Changes by Charles-François Natali : Added file: http://bugs.python.org/file22152/posix_pipe2.diff ___ Python tracker ___ ___ Python-bugs-list

[issue12196] add pipe2() to the os module

2011-05-27 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file22147/posix_pipe2.diff ___ Python tracker ___ ___ Python-bugs-li

[issue12196] add pipe2() to the os module

2011-05-27 Thread Charles-François Natali
Charles-François Natali added the comment: > 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. Fi

[issue12196] add pipe2() to the os module

2011-05-27 Thread STINNER Victor
STINNER Victor added the comment: +self.assertRaises(TypeError, os.pipe2, (0, 0)) Do you want to call the function with two arguments or one tuple with 2 items? You may test both :-) +# try a write big enough to fill-up the pipe (64K on most kernels): this +# should p

[issue12196] add pipe2() to the os module

2011-05-27 Thread Charles-François Natali
New submission from Charles-François Natali : pipe2() makes it possible to create a pipe O_CLOEXEC or O_NONBLOCK atomically, which can be quite useful, especially in multi-threaded code. It would be nice to expose it in the os module. Patch attached. -- components: Library (Lib) files: