[Python-bugs-list] [Bug #122588] xmllib unable to parse "german scharfes " in UTF8 format

noreply@sourceforge.net noreply@sourceforge.net
Thu, 16 Nov 2000 06:27:14 -0800

Bug #122588, was updated on 2000-Nov-16 06:15
Here is a current snapshot of the bug.

Project: Python
Category: XML
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: xmllib unable to parse "german scharfes " in UTF8 format

Details: The xmllib.XMLParser seems to be unable to parse 
an XML file that contains 0xc3 0x9f (UTF8 representation
of the german ).

Python 2.0 (Linux i386) always give me the following 

suxlap@/tmp/xx(2)% python test.py test.xml
<?xml version="1.0" encoding="UTF-8" ?>


Traceback (most recent call last):
  File "test.py", line 20, in ?
  File "/opt/python-2.0/lib/python2.0/xmllib.py", line 165, in feed
  File "/opt/python-2.0/lib/python2.0/xmllib.py", line 261, in goahead
    self.syntax_error('illegal character in content')
  File "/opt/python-2.0/lib/python2.0/xmllib.py", line 786, in syntax_error
    raise RuntimeError, 'Syntax error at line %d: %s' % (self.lineno, message)
RuntimeError: Syntax error at line 3: illegal character in content         

Other UTF8 characters seem to work


Date: 2000-Nov-16 06:27
By: none

Did you pass the keyword option "accept_utf8=1" to the
constructor of the parser ?
Marc-Andre Lemburg

For detailed info, follow this link: