Message1837

Author dgraham1980
Recipients
Date 2007-08-13.22:19:18
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The mktemp() method intermittently fails on Windows with this error message:
  File "...\jython\Lib\tempfile.py", line 142, in mktemp
  File "...\jython\Lib\tempfile.py", line 38, in gettempdir
  File "...\jython\Lib\tempfile.py", line 93, in _gettempdir_inner
  File "...\jython\Lib\javaos.py", line 125, in remove
OSError: [Errno 0] couldn't delete file: C:\DOCUME~1\datapal\LOCALS~1\Temp\tmptest

The comment for the _gettempdir_inner method indicates the use of a synchronized lock around the method to prevent a race condition of multiple threads trying to create and delete the same file name at the same time.  This lock works fine for a single multi-threaded jython application.  It does not work when you have 2 separate jython apps running at the same time.  One app tries to delete the tmptest file while the other is using it and you get this error.

We have patched _gettempdir_inner to append the current timestamp to the tmptest file name using time.time().  This has fixed the problem for us.

Any chance at this fix making it into the 2.2 final release?  We're using 2.2 RC3 now.

Thanks!
History
Date User Action Args
2008-02-20 17:17:59adminlinkissue1773543 messages
2008-02-20 17:17:59admincreate