Issue1479

classification
Title: xml parser file lock
Type: behaviour Severity: normal
Components: Core Versions: 2.5.1
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pjenvey Nosy List: boisgera, gdoutch, pjenvey
Priority: high Keywords:

Created on 2009-09-29.08:25:21 by gdoutch, last changed 2010-04-10.02:13:20 by pjenvey.

Files
File name Uploaded Description Edit Remove
lock.py gdoutch, 2009-09-29.08:25:20 Sample script including unittest
ElementTree.py gdoutch, 2009-09-29.08:49:38 Modified Lib\xml\etree\ElementTree.py
Messages
msg5200 (view) Author: Gareth Doutch (gdoutch) Date: 2009-09-29.08:25:19
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).
 
I am using Jython 2.5.1 on Windows XP and java version "1.6.0_16".

>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
msg5201 (view) Author: Gareth Doutch (gdoutch) Date: 2009-09-29.08:49:38
Submit a modified ElementTree.py file to "cure" the issue.
msg5207 (view) Author: Gareth Doutch (gdoutch) Date: 2009-09-30.12:49:41
I had no problem using this module in Jython 2.2.1
msg5211 (view) Author: Philip Jenvey (pjenvey) Date: 2009-10-01.01:34:18
I don't see how you wouldn't be able to reproduce this on 2.2.1 on Windows 
with the same jython-elementtree, unless you got lucky and GC kicked in 
before you tried removing the file
msg5312 (view) Author: Gareth Doutch (gdoutch) Date: 2009-11-16.16:02:14
http://bugs.python.org/issue7334
msg5649 (view) Author: Philip Jenvey (pjenvey) Date: 2010-04-10.02:13:20
fixed in r7012
History
Date User Action Args
2010-04-10 02:13:20pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg5649
2009-11-17 04:15:45pjenveysetpriority: high
assignee: pjenvey
2009-11-16 16:02:15gdoutchsetmessages: + msg5312
2009-10-01 01:34:18pjenveysetnosy: + pjenvey, boisgera
messages: + msg5211
2009-09-30 12:49:42gdoutchsetmessages: + msg5207
2009-09-29 08:49:41gdoutchsetfiles: + ElementTree.py
messages: + msg5201
2009-09-29 08:25:21gdoutchcreate