diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2005-12-04 19:53:45 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2005-12-04 19:53:45 (GMT) |
commit | 593d6b311e03b745e7b736f3d72269a684359924 (patch) | |
tree | 25f6abf5b6b400851f78408f76e786530c5f050d /Lib | |
parent | bdb3901001fbf8a4cb68da75cd05ad12f79efd03 (diff) | |
download | cpython-593d6b311e03b745e7b736f3d72269a684359924.zip cpython-593d6b311e03b745e7b736f3d72269a684359924.tar.gz cpython-593d6b311e03b745e7b736f3d72269a684359924.tar.bz2 |
[Bug #1281032] Pass encoding from the input source to pyexpat's ParserCreate()
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/xml/sax/expatreader.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py index ab8cbc1..bb9c294 100644 --- a/Lib/xml/sax/expatreader.py +++ b/Lib/xml/sax/expatreader.py @@ -243,13 +243,14 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): def reset(self): if self._namespaces: - self._parser = expat.ParserCreate(None, " ", + self._parser = expat.ParserCreate(self._source.getEncoding(), " ", intern=self._interning) self._parser.namespace_prefixes = 1 self._parser.StartElementHandler = self.start_element_ns self._parser.EndElementHandler = self.end_element_ns else: - self._parser = expat.ParserCreate(intern = self._interning) + self._parser = expat.ParserCreate(self._source.getEncoding(), + intern = self._interning) self._parser.StartElementHandler = self.start_element self._parser.EndElementHandler = self.end_element |