From: Benjamin Peterson Date: Sun, 31 Oct 2010 20:03:32 +0000 (+0000) Subject: close the source's byte stream X-Git-Tag: v3.2a4~210 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90b60a61d8aeeaa0f4c945965d559bab2fb26101;p=python close the source's byte stream --- diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py index c9fc894cb0..a227cdab57 100644 --- a/Lib/xml/sax/expatreader.py +++ b/Lib/xml/sax/expatreader.py @@ -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 = \