New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xmllib unable to parse in UTF8 format #71307
Comments
The xmllib.XMLParser seems to be unable to parse File "xmllib.pyc", line 172, in feed |
Could you please provide minimal reproducer? Minimal script and minimal data that expose the issue. |
I have attached xmllib.py. This file is in python23\lib folder. The strings in XML file are in cyrillic language. My code: class Parser(xmllib.XMLParser):
# a simple styling engine
def __init__(self):
xmllib.XMLParser.__init__(self)
self.cursupervisore = None
self.curdata = ''
self.elements = {'Superv':(self.starttag_superv, self.endtag_superv)
........
}
def load(self, file):
while 1:
s = file.readline()
if not s:
break
self.feed(s)
self.close()
def read_plant_tree(filexml):
c = Parser()
c.load(filexml) |
See also bpo-222587. Seems this was the reason why the xmllib module was deprecated. Use the xml package for parsing XML (xml.etree.ElementTree, xml.dom.minidom, xml.sax, etc). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: