[XML-SIG] [ pyxml-Bugs-802617 ] utf-8 parsing does not work in PyXML 0.8.3

SourceForge.net noreply at sourceforge.net
Mon Sep 8 11:20:30 EDT 2003


Bugs item #802617, was opened at 2003-09-08 20:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=802617&group_id=6473

Category: xmlproc
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Ilpo Nyyssönen (biny)
Assigned to: Lars Marius Garshol (larsga)
Summary: utf-8 parsing does not work in PyXML 0.8.3

Initial Comment:
Parsing XML file that contains data in utf-8 encoding

is not parsed correctly. The problem is that the

datasize is calculated before decoding the data and not

updated when the data is converted to unicode. If there

is multibyte characters, the datasize is left too big

and the parsing fails.



Here is the exception:



  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/dom/ext/reader/Sax2.py",

line 372, in fromStream

    self.parser.parse(s)

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/sax/xmlreader.py",

line 125, in parse

    self.close()

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/sax/drivers2/drv_xmlproc.py",

line 99, in close

    self._parser.flush()

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/parsers/xmlproc/xmlval.py",

line 107, in flush

    self.parser.flush()

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/parsers/xmlproc/xmlutils.py",

line 361, in flush

    self.do_parse()

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/parsers/xmlproc/xmlproc.py",

line 112, in do_parse

    self.parse_data()

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/parsers/xmlproc/xmlproc.py",

line 386, in parse_data

    self.report_error(3029)

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/parsers/xmlproc/xmlproc.py",

line 63, in report_error

    EntityParser.report_error(self,number,args)

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/parsers/xmlproc/xmlutils.py",

line 524, in report_error

    self.err.fatal(msg)

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/sax/drivers2/drv_xmlproc.py",

line 229, in fatal

   

self._err_handler.fatalError(saxlib.SAXParseException(msg,

None, self))

  File

"/opt/python-2.3/lib/python2.3/site-packages/_xmlplus/dom/ext/reader/Sax2.py",

line 340, in fatalError

    raise exception

xml.sax._exceptions.SAXParseException:

timeless-calendar.xml:85:13: Character data not allowed

outside root element



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=802617&group_id=6473



More information about the XML-SIG mailing list