]> granicus.if.org Git - python/commit
SF bug 613233: test_threadedtempfile hangs
authorTim Peters <tim.peters@gmail.com>
Wed, 25 Sep 2002 20:32:28 +0000 (20:32 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 25 Sep 2002 20:32:28 +0000 (20:32 +0000)
commitd8a9d2a0e964d1018f1ba4fa3857a3f061a24137
treec43ee55da2227a7d115a0fedf920f468723ce307
parent7dfb6e295b4e4a8a5554debaf93e260c30725f18
SF bug 613233: test_threadedtempfile hangs

A possibility to deadlock (on the hidden import lock) was created here
in 2.3, seemingly when tempfile.py started to call functions in
random.py.  The cure is "the usual":  don't spawn threads as a side
effect of importing, when the spawned threads themselves do imports
(directly or indirectly), and the code that spawned the threads is
waiting for the threads to finish (they can't finish, because they're
waiting for the import lock the spawner still holds).  Worming around
this is why the "test_main" mechanism was introduced in regrest, so
it's a straightforward fix.

NOT a bugfix candidate; the problem was introduced in 2.3.
Lib/test/test_threadedtempfile.py