Issue 1479: xml parser file lock (original) (raw)

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:20 pjenvey set status: open -> closedresolution: fixedmessages: +
2009-11-17 04:15:45 pjenvey set priority: highassignee: pjenvey
2009-11-16 16:02:15 gdoutch set messages: +
2009-10-01 01:34:18 pjenvey set nosy: + pjenvey, boisgeramessages: +
2009-09-30 12:49:42 gdoutch set messages: +
2009-09-29 08:49:41 gdoutch set files: + ElementTree.pymessages: +
2009-09-29 08:25:21 gdoutch create