]> granicus.if.org Git - python/commitdiff
close the source's byte stream
authorBenjamin Peterson <benjamin@python.org>
Sun, 31 Oct 2010 20:03:32 +0000 (20:03 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 31 Oct 2010 20:03:32 +0000 (20:03 +0000)
Lib/xml/sax/expatreader.py

index c9fc894cb087a4dd47612c6ee14df0e5c6ff8d9a..a227cdab572f66d031f482af08a929fed48de52f 100644 (file)
@@ -219,6 +219,9 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
         self._parsing = 0
         # break cycle created by expat handlers pointing to our methods
         self._parser = None
+        bs = self._source.getByteStream()
+        if bs is not None:
+            bs.close()
 
     def _reset_cont_handler(self):
         self._parser.ProcessingInstructionHandler = \