Hello all,
We recently (about a week ago) sent a patch to the maintainer of
xmlproc, but we didn't receive a reply yet. A look at the site reveals
that the last update was somewhere in 2000.
Does anybody know who the current maintainer is (if that changed), or
what the status of xmlproc is? We kind of depend on it...
The patch fixes a buffering problem if the XML contains utf-8 codes,
which gets especially problematic if one such character pair starts as
the last byte in the buffer... Patch attached, in case someone can use it.
Regards,
Alban Hertroys,
MAG Productions.
--- ../xmlproc-backup/xmlutils.py 2005-03-11 11:04:44.000000 000 +0100
+++ xmlutils.py 2005-03-11 13:45:43.000000 000 +0100
@@ -264,8 +264,8 @@
decoder could have run out of data. The latter case is very
hard to determine in Python 2.0"""
- if str(exc) in ["UTF-8 decoding error: unexpected end of data",
- "UTF-16 decoding error: truncated data"]:
+ s = str(exc)
+ if s.find('unexpec ted end of data')!=-1 or s.find('truncat ed data')!=-1:
while 1:
self.encoded_da ta = new_data[-1]+self.encoded_d ata
new_data = new_data[:-1]
@@ -296,7 +296,7 @@
first_feed = 1
self.parseStart ()
- new_data = new_data + self.encoded_da ta
+ new_data = self.encoded_da ta + new_data
self.encoded_da ta = ""
if not decoded and not self.charset_co nverter:
@@ -720,6 +720,7 @@
# to the recoding.
try:
self.data = self.charset_co nverter(self.da ta)
+ self.datasize = len(self.data)
except UnicodeError, e:
self._handle_de coding_error(se lf.data, e)
self.input_enco ding = enc1
We recently (about a week ago) sent a patch to the maintainer of
xmlproc, but we didn't receive a reply yet. A look at the site reveals
that the last update was somewhere in 2000.
Does anybody know who the current maintainer is (if that changed), or
what the status of xmlproc is? We kind of depend on it...
The patch fixes a buffering problem if the XML contains utf-8 codes,
which gets especially problematic if one such character pair starts as
the last byte in the buffer... Patch attached, in case someone can use it.
Regards,
Alban Hertroys,
MAG Productions.
--- ../xmlproc-backup/xmlutils.py 2005-03-11 11:04:44.000000 000 +0100
+++ xmlutils.py 2005-03-11 13:45:43.000000 000 +0100
@@ -264,8 +264,8 @@
decoder could have run out of data. The latter case is very
hard to determine in Python 2.0"""
- if str(exc) in ["UTF-8 decoding error: unexpected end of data",
- "UTF-16 decoding error: truncated data"]:
+ s = str(exc)
+ if s.find('unexpec ted end of data')!=-1 or s.find('truncat ed data')!=-1:
while 1:
self.encoded_da ta = new_data[-1]+self.encoded_d ata
new_data = new_data[:-1]
@@ -296,7 +296,7 @@
first_feed = 1
self.parseStart ()
- new_data = new_data + self.encoded_da ta
+ new_data = self.encoded_da ta + new_data
self.encoded_da ta = ""
if not decoded and not self.charset_co nverter:
@@ -720,6 +720,7 @@
# to the recoding.
try:
self.data = self.charset_co nverter(self.da ta)
+ self.datasize = len(self.data)
except UnicodeError, e:
self._handle_de coding_error(se lf.data, e)
self.input_enco ding = enc1
Comment