I know there is an issue with file locks being retained after files are closed on Windows:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4715154

And I think the features that trigger this bug are used in Jython. The symptoms described here are exactly the ones I've seen with this issue before.

I know a guy with excellent knowledge in this area, I'll get back when I've consulted him on how this can be worked around on the insides of Jython. Until then your best bet is to use a better operating system.

cheers,
Tobias

On Mon, Sep 28, 2009 at 4:53 PM, DOUTCH GARETH-GDO003 <Gareth.Doutch@motorola.com> wrote:
Hi there,
 
I have a problem with an xml file locking after read and/or write.
 
I have a short sample code with unit test attached. Below are the outputs from Jython and CPython (v 2.5.4). Is this a bug?
Can anybody offer an alternative workaround?
 
I am using Jython 2.5.1 on Windows XP and java version "1.6.0_16".
 
Cheers,
 
Gareth
 
 
>jython lock.py
E
======================================================================
ERROR: runTest (__main__.TestDelete)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "W:\testTeam\SIT\JySit\sit\scripts\lock.py", line 73, in tearDown
    os.remove(self.fileName)
  File "C:\jython2.5.1\Lib\os.py", line 342, in remove
    raise OSError(0, "couldn't delete file", path)
OSError: [Errno 0] couldn't delete file: 'C:\\testdir\\test.xml'
 
----------------------------------------------------------------------
Ran 1 test in 0.454s
 
FAILED (errors=1)
 
 
>python lock.py
.
----------------------------------------------------------------------
Ran 1 test in 0.015s
 
OK
 

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users