]> granicus.if.org Git - python/commit
bpo-27448: Work around a gc.disable race condition in subprocess. (#1932)
authorGregory P. Smith <greg@krypto.org>
Tue, 5 Sep 2017 18:20:02 +0000 (11:20 -0700)
committerGitHub <noreply@github.com>
Tue, 5 Sep 2017 18:20:02 +0000 (11:20 -0700)
commit5e8e371364ee58dadb9a4e4e51c7e9cf6bedbfae
treead244d74a8a78950a508a59cf3afd2b7952a549e
parent9721e51daf59e9a2f56dbf7c2428ea79c0b13be0
bpo-27448: Work around a gc.disable race condition in subprocess. (#1932)

* bpo-27448: Work around a gc.disable race condition in subprocess.

This works around a gc.isenabled/gc.disable race condition in the 2.7
subprocess module by using a lock for the critical section.  It'll
prevent multiple simultaneous subprocess launches from winding up with
gc remaining disabled but it can't fix the ultimate problem: gc enable
and disable is a global setting and a hack.

Users are *strongly encouraged* to use subprocess32 from PyPI instead
of the 2.7 standard library subprocess module.  Mixing threads with
subprocess is a recipie for disaster otherwise even with "fixes" to
ameliorate common issues like this.

* Add a blurb!
Lib/subprocess.py
Misc/NEWS.d/next/Library/2017-09-05-10-55-50.bpo-27448.QdAqzZ.rst [new file with mode: 0644]