[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-12-01 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- resolution: fixed - stage: committed/rejected - commit review status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15798 ___

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset efcdf2a70f2a by Gregory P. Smith in branch '3.3': Undo supposed fix for Issue #15798 until I understand why this is http://hg.python.org/cpython/rev/efcdf2a70f2a New changeset ddbf9632795b by Gregory P. Smith in branch 'default': Undo supposed fix

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-12-01 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15798 ___

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2df5e1f537b0 by Gregory P. Smith in branch 'default': Fixes issue #15798: subprocess.Popen() no longer fails if file http://hg.python.org/cpython/rev/2df5e1f537b0 -- ___ Python tracker

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 07425df887b5 by Gregory P. Smith in branch '3.3': Fixes issue #15798: subprocess.Popen() no longer fails if file http://hg.python.org/cpython/rev/07425df887b5 -- ___ Python tracker rep...@bugs.python.org

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-12-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: i went with the less invasive in terms of behavior change approach of making sure that the errpipe_write fd is always = 3. In Python 3.4 the code change was different and much simpler and on the Python only side as all fd's are opened O_CLOEXEC by default.

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-11-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset c4cd891cf167 by Gregory P. Smith in branch '3.3': Fixes Issue #15798 - subprocess.Popen() no longer fails if file http://hg.python.org/cpython/rev/c4cd891cf167 New changeset 0387054b2038 by Gregory P. Smith in branch 'default': Fixes Issue #15798 -

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-11-30 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: +Python 3.4 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15798

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-11-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: adding {0,1,2} to fds_to_keep (populated from pass_fds) is indeed an alternate approach. A variant of an alternate patch doing that attached. This actually simplifies code. Is there anything this would hurt that i'm not seeing? I suppose it adds minor

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2013-08-13 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15798 ___ ___ Python-bugs-list

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-30 Thread Ross Lagerwall
Ross Lagerwall added the comment: I sent a review through on rietveld; I'm attaching a patch with the changes so that it compiles and passes the tests. -- Added file: http://bugs.python.org/file27053/issue15798_v2.patch ___ Python tracker

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: I haven't tested Ross's latest patch, but it looks ok to me. -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15798 ___

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-30 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15798 ___ ___

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-30 Thread Richard Oudkerk
Richard Oudkerk added the comment: Would it simplify matters to stop treating 0,1,2 specially and just add them to pass_fds instead? -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15798

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-29 Thread Ross Lagerwall
Ross Lagerwall added the comment: It's caused by the following check in _posixsubprocess.c: if (close_fds errpipe_write 3) { /* precondition */ PyErr_SetString(PyExc_ValueError, errpipe_write must be = 3); return NULL; } which was written by Gregory P. Smith in 2010

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-29 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15798 ___ ___ Python-bugs-list

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: easy enough to reproduce... $ ./python.exe -c 'import os, subprocess as s; os.close(0); os.close(1); s.Popen([/bin/true])' Traceback (most recent call last): File string, line 1, in module File /Users/gps/python/hg/default/Lib/subprocess.py, line 818, in

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-29 Thread Ross Lagerwall
Ross Lagerwall added the comment: The attached patch + test seems to fix the issue. It's not very elegant. -- keywords: +patch Added file: http://bugs.python.org/file27042/issue15798.patch ___ Python tracker rep...@bugs.python.org

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: Yes, something along the lines of that patch is what I was thinking. BTW, this is only necessary for the errpipe_write fd. errpipe_read is for the parent process. I'm going to do it within _create_pipe so that the optimal _posixsubprocess.cloexec_pipe

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-29 Thread Aleksey Filippov
Aleksey Filippov added the comment: It may be implemented simplier. fcntl(fd, F_DUPFD_CLOEXEC, min_fd_number) will allocate new fd at least min_fd_number. So, it is not necessary to do a lot of dup() calls. -- ___ Python tracker

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: F_DUPFD_CLOEXEC appears exclusive to modern Linux kernels. Any idea how wide spread support for plain F_DUPFD is? If that is everywhere the code I've just whipped up could lose a lot of loops... -- ___ Python

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: Here's my initial fix. If fcntl(errpipe_write, F_DUPFD, 3) is widely available this could be shrunk a bit to avoid the for loop potentially calling dup a few times and tracking the wasted fds to close later. Otherwise if it isn't I'd rather not bother with

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-28 Thread Aleksey Filippov
New submission from Aleksey Filippov: System info: kernel: 3.4.8-1-ARCH dist: Arch linux python: 3.2.3 subprocess.Popen() fails if python interpreter is started with closed 0, 1 or 2 descriptor. Traceback (most recent call last): File string, line 14, in module File

[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

2012-08-28 Thread Ezio Melotti
Ezio Melotti added the comment: #10806 seems related. -- components: +Library (Lib) nosy: +ezio.melotti, pitrou, rosslagerwall type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15798