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
13f51d9e
Unverified
Kaydet (Commit)
13f51d9e
authored
Haz 03, 2018
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Haz 03, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-33761: Fix a file leak in test_iterparse in test_xml_etree. (GH-7358)
üst
e95dfc50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
test_xml_etree.py
Lib/test/test_xml_etree.py
+5
-3
No files found.
Lib/test/test_xml_etree.py
Dosyayı görüntüle @
13f51d9e
...
...
@@ -617,6 +617,7 @@ class ElementTreeTest(unittest.TestCase):
self
.
assertEqual
(
str
(
cm
.
exception
),
'junk after document element: line 1, column 12'
)
self
.
addCleanup
(
support
.
unlink
,
TESTFN
)
with
open
(
TESTFN
,
"wb"
)
as
f
:
f
.
write
(
b
"<document />junk"
)
it
=
iterparse
(
TESTFN
)
...
...
@@ -2849,9 +2850,6 @@ class ElementSlicingTest(unittest.TestCase):
class
IOTest
(
unittest
.
TestCase
):
def
tearDown
(
self
):
support
.
unlink
(
TESTFN
)
def
test_encoding
(
self
):
# Test encoding issues.
elem
=
ET
.
Element
(
"tag"
)
...
...
@@ -2922,12 +2920,14 @@ class IOTest(unittest.TestCase):
"<tag key=
\"
åöö<>
\"
/>"
%
enc
)
.
encode
(
enc
))
def
test_write_to_filename
(
self
):
self
.
addCleanup
(
support
.
unlink
,
TESTFN
)
tree
=
ET
.
ElementTree
(
ET
.
XML
(
'''<site />'''
))
tree
.
write
(
TESTFN
)
with
open
(
TESTFN
,
'rb'
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
b
'''<site />'''
)
def
test_write_to_text_file
(
self
):
self
.
addCleanup
(
support
.
unlink
,
TESTFN
)
tree
=
ET
.
ElementTree
(
ET
.
XML
(
'''<site />'''
))
with
open
(
TESTFN
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
tree
.
write
(
f
,
encoding
=
'unicode'
)
...
...
@@ -2936,6 +2936,7 @@ class IOTest(unittest.TestCase):
self
.
assertEqual
(
f
.
read
(),
b
'''<site />'''
)
def
test_write_to_binary_file
(
self
):
self
.
addCleanup
(
support
.
unlink
,
TESTFN
)
tree
=
ET
.
ElementTree
(
ET
.
XML
(
'''<site />'''
))
with
open
(
TESTFN
,
'wb'
)
as
f
:
tree
.
write
(
f
)
...
...
@@ -2944,6 +2945,7 @@ class IOTest(unittest.TestCase):
self
.
assertEqual
(
f
.
read
(),
b
'''<site />'''
)
def
test_write_to_binary_file_with_bom
(
self
):
self
.
addCleanup
(
support
.
unlink
,
TESTFN
)
tree
=
ET
.
ElementTree
(
ET
.
XML
(
'''<site />'''
))
# test BOM writing to buffered file
with
open
(
TESTFN
,
'wb'
)
as
f
:
...
...
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