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
___
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
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15798
___
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
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
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.
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 -
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
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
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15798
___
___
Python-bugs-list
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
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
___
Changes by Andrew Svetlov andrew.svet...@gmail.com:
--
nosy: +asvetlov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15798
___
___
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
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
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15798
___
___
Python-bugs-list
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
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
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
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
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
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
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
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
24 matches
Mail list logo