Discussion:
[Python-3000-checkins] r66203 - in python/branches/py3k/Lib: test/test_sax.py xml/sax/xmlreader.py
benjamin.peterson
2008-09-04 02:22:52 UTC
Permalink
Author: benjamin.peterson
Date: Thu Sep 4 04:22:52 2008
New Revision: 66203

Log:
#2501 xml.sax.parser doesn't terminate when given a filename; enable some more tests!

Reviewed by myself


Modified:
python/branches/py3k/Lib/test/test_sax.py
python/branches/py3k/Lib/xml/sax/xmlreader.py

Modified: python/branches/py3k/Lib/test/test_sax.py
==============================================================================
--- python/branches/py3k/Lib/test/test_sax.py (original)
+++ python/branches/py3k/Lib/test/test_sax.py Thu Sep 4 04:22:52 2008
@@ -446,8 +446,7 @@

# ===== 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 @@

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 @@
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()

Modified: python/branches/py3k/Lib/xml/sax/xmlreader.py
==============================================================================
--- python/branches/py3k/Lib/xml/sax/xmlreader.py (original)
+++ python/branches/py3k/Lib/xml/sax/xmlreader.py Thu Sep 4 04:22:52 2008
@@ -119,7 +119,7 @@
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()

Loading...