]> granicus.if.org Git - python/commitdiff
#2501 xml.sax.parser doesn't terminate when given a filename; enable some more tests!
authorBenjamin Peterson <benjamin@python.org>
Thu, 4 Sep 2008 02:22:52 +0000 (02:22 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 4 Sep 2008 02:22:52 +0000 (02:22 +0000)
Reviewed by myself

Lib/test/test_sax.py
Lib/xml/sax/xmlreader.py

index 5f1a48ed48e7885040e98608c6d63ae51e55b55e..a45d1f322e00e3f651b4b3a54977dd13ba3cb0a1 100644 (file)
@@ -446,8 +446,7 @@ class ExpatReaderTest(XmlTestBase):
 
     # ===== InputSource support
 
-    def XXXtest_expat_inpsource_filename(self):
-        # FIXME: test blocks indefinitely
+    def test_expat_inpsource_filename(self):
         parser = create_parser()
         result = StringIO()
         xmlgen = XMLGenerator(result)
@@ -457,8 +456,7 @@ class ExpatReaderTest(XmlTestBase):
 
         self.assertEquals(result.getvalue(), xml_test_out)
 
-    def XXXtest_expat_inpsource_sysid(self):
-        # FIXME: test blocks indefinitely
+    def test_expat_inpsource_sysid(self):
         parser = create_parser()
         result = StringIO()
         xmlgen = XMLGenerator(result)
@@ -531,8 +529,7 @@ class ExpatReaderTest(XmlTestBase):
         self.assertEquals(parser.getPublicId(), None)
         self.assertEquals(parser.getLineNumber(), 1)
 
-    def XXXtest_expat_locator_withinfo(self):
-        # FIXME: test blocks indefinitely
+    def test_expat_locator_withinfo(self):
         result = StringIO()
         xmlgen = XMLGenerator(result)
         parser = create_parser()
index 6264ee3f0189b433194f48228c02288b6fe8ed1a..5ce30b042a5c728078e839899cbdb25b760a11d3 100644 (file)
@@ -119,7 +119,7 @@ class IncrementalParser(XMLReader):
         self.prepareParser(source)
         file = source.getByteStream()
         buffer = file.read(self._bufsize)
-        while buffer != "":
+        while buffer:
             self.feed(buffer)
             buffer = file.read(self._bufsize)
         self.close()