[issue2840] Expat parser locks XML source file if ContentHandler raises an exception

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue15388. Parser doesn't close an input source's 
stream if an exception raised.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> SAX parse (ExpatParser) leaks file handle when given filename 
input

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2840] Expat parser locks XML source file if ContentHandler raises an exception

2010-08-08 Thread Mark Lawrence

Mark Lawrence  added the comment:

I can't reproduce this on Windows Vista from the command line with 2.7 or py3k. 
 Can someone confirm that I'm correct?

--
nosy: +BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2840] Expat parser locks XML source file if ContentHandler raises an exception

2010-06-09 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2840] Expat parser locks XML source file if ContentHandler raises an exception

2008-05-12 Thread Craig Holmquist

New submission from Craig Holmquist <[EMAIL PROTECTED]>:

This was observed in Python 2.5.2 on Windows XP.  Run this code in IDLE:

import xml.sax
from xml.sax.handler import ContentHandler
class C(ContentHandler):
def startElement(self, name, attrs):
assert False

xml.sax.parse(xml_path, C())

Where "xml_path" points to a well-formed XML file.  This will raise an
AssertionError.  Then, attempt to modify or delete the XML file that was
specified; it's still locked by the Python process.

Deleting the ContentHandler does not unlock it.  There doesn't seem any
way to unlock it aside from terminating the Python process.

If the ContentHandler doesn't raise an exception or error, the file is
unlocked properly.

--
components: XML
messages: 66754
nosy: craigneuro
severity: normal
status: open
title: Expat parser locks XML source file if ContentHandler raises an exception
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com