Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/xml/sax/expatreader.py

    r2 r391  
    109109    def prepareParser(self, source):
    110110        if source.getSystemId() is not None:
    111             self._parser.SetBase(source.getSystemId())
     111            base = source.getSystemId()
     112            if isinstance(base, unicode):
     113                base = base.encode('utf-8')
     114            self._parser.SetBase(base)
    112115
    113116    # Redefined setContentHandler to allow changing handlers during parsing
     
    408411
    409412if __name__ == "__main__":
    410     import xml.sax
     413    import xml.sax.saxutils
    411414    p = create_parser()
    412     p.setContentHandler(xml.sax.XMLGenerator())
     415    p.setContentHandler(xml.sax.saxutils.XMLGenerator())
    413416    p.setErrorHandler(xml.sax.ErrorHandler())
    414     p.parse("../../../hamlet.xml")
     417    p.parse("http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml")
Note: See TracChangeset for help on using the changeset viewer.