cpython: fca669149d8a (original) (raw)

Mercurial > cpython

changeset 95432:fca669149d8a

Issue #10590: xml.sax.parseString() now supports string argument. [#10590]

Serhiy Storchaka storchaka@gmail.com
date Sat, 04 Apr 2015 10:12:26 +0300
parents 3eb3a6d45251
children 9db237815042
files Doc/library/xml.sax.rst Lib/test/test_sax.py Lib/xml/sax/__init__.py Misc/NEWS
diffstat 4 files changed, 19 insertions(+), 4 deletions(-)[+] [-] Doc/library/xml.sax.rst 6 Lib/test/test_sax.py 7 Lib/xml/sax/__init__.py 8 Misc/NEWS 2

line wrap: on

line diff

--- a/Doc/library/xml.sax.rst +++ b/Doc/library/xml.sax.rst @@ -47,7 +47,11 @@ The convenience functions are: .. function:: parseString(string, handler, error_handler=handler.ErrorHandler()) Similar to :func:parse, but parses from a buffer string received as a

A typical SAX application uses three kinds of objects: readers, handlers and input sources. "Reader" in this context is another term for parser, i.e. some

--- a/Lib/test/test_sax.py +++ b/Lib/test/test_sax.py @@ -200,6 +200,13 @@ class ParseTest(unittest.TestCase): parseString(s, XMLGenerator(result, 'utf-8')) self.assertEqual(result.getvalue(), xml_str(self.data, 'utf-8'))

+ def test_parseString_bytes(self): # UTF-8 is default encoding, US-ASCII is compatible with UTF-8, # UTF-16 is autodetected

--- a/Lib/xml/sax/init.py +++ b/Lib/xml/sax/init.py @@ -33,8 +33,7 @@ def parse(source, handler, errorHandler= parser.parse(source) def parseString(string, handler, errorHandler=ErrorHandler()):

-

this is the parser list used by the make_parser function if no

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -19,6 +19,8 @@ Core and Builtins Library ------- +- Issue #10590: xml.sax.parseString() now supports string argument. +