Message5376
The xml.sax parser is receiving different read() buffer sizes with each
call. This is in contrast to the CPython implementation, which appears
to call read() with consistent buffer sizes. The following code
demonstrates the issue (I can't seem to create attachments, sorry):
import xml.sax
import StringIO
class Catcher(StringIO.StringIO):
def read(self, size):
print size
return StringIO.StringIO.read(self, size)
s = """<?xml version="1.0"?>\n<root version="2.0"/>"""
handler = xml.sax.handler.ContentHandler()
parser = xml.sax.make_parser()
parser.setContentHandler(handler)
parser.parse(Catcher(s))
Python 2.6 prints
"""
65516
65516
"""
Jython 2.5.1 prints
"""
1
1
1
1
28
8188
8192
"""
I read through the Jython xml.sax module source code but couldn't figure
out why this was happening. |
|
Date |
User |
Action |
Args |
2009-12-14 05:07:59 | kurtmckee | set | recipients:
+ kurtmckee |
2009-12-14 05:07:58 | kurtmckee | set | messageid: <1260767278.89.0.437007837404.issue1523@psf.upfronthosting.co.za> |
2009-12-14 05:07:58 | kurtmckee | link | issue1523 messages |
2009-12-14 05:07:57 | kurtmckee | create | |
|