[ python-Bugs-1473760 ] TempFile can hang on Windows

SourceForge.net noreply at sourceforge.net
Fri Apr 21 19:22:25 CEST 2006


Bugs item #1473760, was opened at 2006-04-20 18:35
Message generated for change (Comment added) made by arigo
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473760&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 7
Submitted By: Tim Peters (tim_one)
Assigned to: Nobody/Anonymous (nobody)
Summary: TempFile can hang on Windows

Initial Comment:
Attached is a simple module.  If you try to import it
("import hang"), it prints "asking for temp file", and
hangs there, never returning from its call to
tempfile.TemporaryFile().  It's in fact stuck in
ntpath.py, on the "from nt import _getfullpathname"
line in function `abspath`.

Of course hang.py spawns another thread, and is hung
waiting for the import lock.  That thread isn't doing
any imports the _user_ knows about, and Python's
standard library should be coded more defensively than
this.

The symptom was reported on zodb-dev today, where
Martin Gfeller reported ZEO hanging on Windows for what
appears to be the same reason:

http://mail.zope.org/pipermail/zodb-dev/2006-April/009989.html

As it says there, it looks like this problem was
introduced (indirectly) by patch

    http://www.python.org/sf/810914

which appears to have been revision 34396 (October
2003! -- but not backported to 2.3, so nobody would
notice this before 2.4).

I haven't dug deeper than this, and don't know why
nobody noticed ZEO hanging before ;-)



----------------------------------------------------------------------

>Comment By: Armin Rigo (arigo)
Date: 2006-04-21 17:22

Message:
Logged In: YES 
user_id=4771

The general problem keeps showing up again and again.
I can't find all reference (I remember more), but there
are at least the following open bugs about it:
#689895 #683658 #1175194.

It would certainly help matters if we implemented
something along the lines of putting a recursive lock on
each module object, held while this specific module is
being imported. More advanced solutions are possible
too, but possibly more disruptive compatibility-wise...

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473760&group_id=5470


More information about the Python-bugs-list mailing list