mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#15970: merge with 3.2.
This commit is contained in:
commit
ab9b661fdd
3 changed files with 16 additions and 1 deletions
|
@ -1809,6 +1809,18 @@ class ElementTreeTest(unittest.TestCase):
|
|||
mye = MyElement('joe')
|
||||
self.assertEqual(mye.newmethod(), 'joe')
|
||||
|
||||
def test_html_empty_elems_serialization(self):
|
||||
# issue 15970
|
||||
# from http://www.w3.org/TR/html401/index/elements.html
|
||||
for element in ['AREA', 'BASE', 'BASEFONT', 'BR', 'COL', 'FRAME', 'HR',
|
||||
'IMG', 'INPUT', 'ISINDEX', 'LINK', 'META', 'PARAM']:
|
||||
for elem in [element, element.lower()]:
|
||||
expected = '<%s>' % elem
|
||||
serialized = serialize(ET.XML('<%s />' % elem), method='html')
|
||||
self.assertEqual(serialized, expected)
|
||||
serialized = serialize(ET.XML('<%s></%s>' % (elem,elem)),
|
||||
method='html')
|
||||
self.assertEqual(serialized, expected)
|
||||
|
||||
class ElementIterTest(unittest.TestCase):
|
||||
def _ilist(self, elem, tag=None):
|
||||
|
|
|
@ -995,7 +995,7 @@ def _serialize_xml(write, elem, qnames, namespaces):
|
|||
write(_escape_cdata(elem.tail))
|
||||
|
||||
HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr",
|
||||
"img", "input", "isindex", "link", "meta" "param")
|
||||
"img", "input", "isindex", "link", "meta", "param")
|
||||
|
||||
try:
|
||||
HTML_EMPTY = set(HTML_EMPTY)
|
||||
|
|
|
@ -32,6 +32,9 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- Issue #15970: xml.etree.ElementTree now serializes correctly the empty HTML
|
||||
elements 'meta' and 'param'.
|
||||
|
||||
- Issue #15842: the SocketIO.{readable,writable,seekable} methods now
|
||||
raise ValueError when the file-like object is closed. Patch by Alessandro
|
||||
Moura.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue