]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Merge rev 45631 from trunk.
authorTim Peters <tim.peters@gmail.com>
Fri, 21 Apr 2006 21:22:00 +0000 (21:22 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 21 Apr 2006 21:22:00 +0000 (21:22 +0000)
commit3a6d19e8be8d657c23d7782b254a363cc69a9767
tree610d6f5dba703e29fe43562c85ee81d1cd6ff88b
parent7555cb576ec2556f53c6663815366daa1ad72b9e
Merge rev 45631 from trunk.

SF bug #1473760 TempFile can hang on Windows.

Python 2.4 changed ntpath.abspath to do an import
inside the function.  As a result, due to Python's
import lock, anything calling abspath on Windows
(directly, or indirectly like tempfile.TemporaryFile)
hung when it was called from a thread spawned as a
side effect of importing a module.

This is a depressingly frequent problem, and
deserves a more general fix.  I'm settling for
a micro-fix here because this specific one accounts
for a report of Zope Corp's ZEO hanging on Windows,
and it was an odd way to change abspath to begin
with (ntpath needs a different implementation
depending on whether we're actually running on
Windows, and the _obvious_ way to arrange for that
is not to bury a possibly-failing import _inside_
the function).

Note that if/when other micro-fixes of this kind
get made, the new Lib/test/threaded_import_hangers.py
is a convenient place to add tests for them.
Lib/ntpath.py
Lib/test/test_threaded_import.py
Lib/test/threaded_import_hangers.py [new file with mode: 0644]
Misc/NEWS