Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c90111f9
Kaydet (Commit)
c90111f9
authored
Eyl 19, 2012
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#15970: xml.etree.ElementTree now serializes correctly the empty HTML elements "meta" and "param".
üst
ab02db23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
test_xml_etree.py
Lib/test/test_xml_etree.py
+20
-0
ElementTree.py
Lib/xml/etree/ElementTree.py
+1
-1
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_xml_etree.py
Dosyayı görüntüle @
c90111f9
...
...
@@ -1851,6 +1851,26 @@ def check_issue10777():
>>> ET.register_namespace('test10777', 'http://myuri/')
"""
def
check_html_empty_elems_serialization
(
self
):
# issue 15970
# from http://www.w3.org/TR/html401/index/elements.html
"""
>>> empty_elems = ['AREA', 'BASE', 'BASEFONT', 'BR', 'COL', 'FRAME', 'HR',
... 'IMG', 'INPUT', 'ISINDEX', 'LINK', 'META', 'PARAM']
>>> elems = ''.join('<
%
s />'
%
elem for elem in empty_elems)
>>> serialize(ET.XML('<html>
%
s</html>'
%
elems), method='html')
'<html><AREA><BASE><BASEFONT><BR><COL><FRAME><HR><IMG><INPUT><ISINDEX><LINK><META><PARAM></html>'
>>> serialize(ET.XML('<html>
%
s</html>'
%
elems.lower()), method='html')
'<html><area><base><basefont><br><col><frame><hr><img><input><isindex><link><meta><param></html>'
>>> elems = ''.join('<
%
s></
%
s>'
%
(elem, elem) for elem in empty_elems)
>>> serialize(ET.XML('<html>
%
s</html>'
%
elems), method='html')
'<html><AREA><BASE><BASEFONT><BR><COL><FRAME><HR><IMG><INPUT><ISINDEX><LINK><META><PARAM></html>'
>>> serialize(ET.XML('<html>
%
s</html>'
%
elems.lower()), method='html')
'<html><area><base><basefont><br><col><frame><hr><img><input><isindex><link><meta><param></html>'
"""
# --------------------------------------------------------------------
...
...
Lib/xml/etree/ElementTree.py
Dosyayı görüntüle @
c90111f9
...
...
@@ -983,7 +983,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
)
...
...
Misc/NEWS
Dosyayı görüntüle @
c90111f9
...
...
@@ -120,6 +120,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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment