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
11fa3ffc
Kaydet (Commit)
11fa3ffc
authored
Eyl 12, 2016
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge
üst
3dad1a5b
076366c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
test_xml_etree.py
Lib/test/test_xml_etree.py
+8
-0
ElementTree.py
Lib/xml/etree/ElementTree.py
+11
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_xml_etree.py
Dosyayı görüntüle @
11fa3ffc
...
...
@@ -409,6 +409,14 @@ class ElementTreeTest(unittest.TestCase):
self
.
assertEqual
(
ET
.
tostring
(
elem
),
b
'<test testa="testval" testb="test1" testc="test2">aa</test>'
)
elem
=
ET
.
Element
(
'test'
)
elem
.
set
(
'a'
,
'
\r
'
)
elem
.
set
(
'b'
,
'
\r\n
'
)
elem
.
set
(
'c'
,
'
\t\n\r
'
)
elem
.
set
(
'd'
,
'
\n\n
'
)
self
.
assertEqual
(
ET
.
tostring
(
elem
),
b
'<test a=" " b=" " c="	 " d=" " />'
)
def
test_makeelement
(
self
):
# Test makeelement handling.
...
...
Lib/xml/etree/ElementTree.py
Dosyayı görüntüle @
11fa3ffc
...
...
@@ -1084,8 +1084,19 @@ def _escape_attrib(text):
text
=
text
.
replace
(
">"
,
">"
)
if
"
\"
"
in
text
:
text
=
text
.
replace
(
"
\"
"
,
"""
)
# The following business with carriage returns is to satisfy
# Section 2.11 of the XML specification, stating that
# CR or CR LN should be replaced with just LN
# http://www.w3.org/TR/REC-xml/#sec-line-ends
if
"
\r\n
"
in
text
:
text
=
text
.
replace
(
"
\r\n
"
,
"
\n
"
)
if
"
\r
"
in
text
:
text
=
text
.
replace
(
"
\r
"
,
"
\n
"
)
#The following four lines are issue 17582
if
"
\n
"
in
text
:
text
=
text
.
replace
(
"
\n
"
,
" "
)
if
"
\t
"
in
text
:
text
=
text
.
replace
(
"
\t
"
,
"	"
)
return
text
except
(
TypeError
,
AttributeError
):
_raise_serialization_error
(
text
)
...
...
Misc/NEWS
Dosyayı görüntüle @
11fa3ffc
...
...
@@ -209,6 +209,9 @@ Library
- Issue #24594: Validates persist parameter when opening MSI database
- Issue #17582: xml.etree.ElementTree nows preserves whitespaces in attributes
(Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.)
- Issue #28047: Fixed calculation of line length used for the base64 CTE
in the new email policies.
...
...
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