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
67245a6e
Kaydet (Commit)
67245a6e
authored
Mar 05, 2012
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #14168: Check for presence of _attrs before accessing it.
üst
f1c42599
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
test_minidom.py
Lib/test/test_minidom.py
+12
-3
minidom.py
Lib/xml/dom/minidom.py
+4
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_minidom.py
Dosyayı görüntüle @
67245a6e
...
...
@@ -362,11 +362,17 @@ class MinidomTest(unittest.TestCase):
def
testGetAttrList
(
self
):
pass
def
testGetAttrValues
(
self
):
pass
def
testGetAttrValues
(
self
):
pass
def
testGetAttrLength
(
self
):
pass
def
testGetAttrLength
(
self
):
pass
def
testGetAttribute
(
self
):
pass
def
testGetAttribute
(
self
):
dom
=
Document
()
child
=
dom
.
appendChild
(
dom
.
createElementNS
(
"http://www.python.org"
,
"python:abc"
))
self
.
assertEqual
(
child
.
getAttribute
(
'missing'
),
''
)
def
testGetAttributeNS
(
self
):
dom
=
Document
()
...
...
@@ -378,6 +384,9 @@ class MinidomTest(unittest.TestCase):
'http://www.python.org'
)
self
.
assertEqual
(
child
.
getAttributeNS
(
"http://www.w3.org"
,
"other"
),
''
)
child2
=
child
.
appendChild
(
dom
.
createElement
(
'abc'
))
self
.
assertEqual
(
child2
.
getAttributeNS
(
"http://www.python.org"
,
"missing"
),
''
)
def
testGetAttributeNode
(
self
):
pass
...
...
Lib/xml/dom/minidom.py
Dosyayı görüntüle @
67245a6e
...
...
@@ -723,12 +723,16 @@ class Element(Node):
Node
.
unlink
(
self
)
def
getAttribute
(
self
,
attname
):
if
self
.
_attrs
is
None
:
return
""
try
:
return
self
.
_attrs
[
attname
]
.
value
except
KeyError
:
return
""
def
getAttributeNS
(
self
,
namespaceURI
,
localName
):
if
self
.
_attrsNS
is
None
:
return
""
try
:
return
self
.
_attrsNS
[(
namespaceURI
,
localName
)]
.
value
except
KeyError
:
...
...
Misc/NEWS
Dosyayı görüntüle @
67245a6e
...
...
@@ -511,6 +511,8 @@ Core and Builtins
Library
-------
-
Issue
#
14168
:
Check
for
presence
of
_attrs
before
accessing
it
.
-
Issue
#
14195
:
An
issue
that
caused
weakref
.
WeakSet
instances
to
incorrectly
return
True
for
a
WeakSet
instance
'a'
in
both
'a < a'
and
'a > a'
has
been
fixed
.
...
...
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