[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: That test is gross... it creates a nasty cycle of an instance back to itself via a stubbed out nested function's enclosing scope. I'm sanitizing it now to simplify the code and not have any cycles. -- ___ Python t

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Mark Dickinson
Mark Dickinson added the comment: Adding 'del p' at the end of the test method fixes this for me. -- ___ Python tracker ___ ___ Python

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Mark Dickinson
Mark Dickinson added the comment: test_gc and test_csv seem to be failing on some of the buildbots as a result of these checkins. It looks as though the new test_subprocess test creates some uncollectable garbage. -- nosy: +mark.dickinson ___ Pytho

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- stage: test needed -> committed/rejected ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- resolution: -> fixed status: open -> closed versions: +Python 2.7 ___ Python tracker ___ ___ Python-

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2bdd984a55ac by Gregory P. Smith in branch '2.7': Fix issue #16140 bug that the fix to issue #16327 added - don't double http://hg.python.org/cpython/rev/2bdd984a55ac -- ___ Python tracker

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6ebfdfe74c04 by Gregory P. Smith in branch '3.2': Fixes issue #16140: The subprocess module no longer double closes its http://hg.python.org/cpython/rev/6ebfdfe74c04 New changeset 9f8b0444c8a6 by Gregory P. Smith in branch '3.3': Fixes issue #16140:

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: To remove the double close fd-reuse-window race condition you describe in 3.2.3 and later I don't think you even need to add that code snippet. Just get rid of the for loop calling os.close on those three fd's all together. self.stdin, self.stdout and self

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-10-05 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-10-05 Thread Benno Leslie
Benno Leslie added the comment: Regarding #2 my understanding is that the FDs are already always wrapped. E.g: at line http://hg.python.org/cpython/file/b9ac3c44a4eb/Lib/subprocess.py#l798 it shows these always being wrapped (assuming the file descriptor is not -1). For my test case on 3.2.3,

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-10-05 Thread Benno Leslie
Changes by Benno Leslie : -- nosy: +bennoleslie ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-10-05 Thread Gregory P. Smith
Gregory P. Smith added the comment: What you've described makes sense. The file descriptors are indeed conditionally wrapped in file objects using io.open which could lead to a double close in the error case in a threaded application. yuck. 1) The code needs to check if the fd was wrapped be

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-10-05 Thread Ross Lagerwall
Changes by Ross Lagerwall : -- nosy: +rosslagerwall ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-10-04 Thread Gregory P. Smith
New submission from Gregory P. Smith: Ben Leslie writes this on python-dev: Hi all, I have a Python program where I have many threads each calling Popen, and I was hitting some trouble. I've been seeing this on 3.2.3, however I believe the same issue is still potentially a problem on head.