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
e36837cb
Kaydet (Commit)
e36837cb
authored
Haz 04, 2018
tarafından
Serhiy Storchaka
Kaydeden (comit)
Ned Deily
Haz 04, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-33760: Fix file leaks in test_io. (GH-7361)
üst
47a6c79f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
test_io.py
Lib/test/test_io.py
+4
-0
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
e36837cb
...
...
@@ -1516,6 +1516,7 @@ class CBufferedReaderTest(BufferedReaderTest, SizeofTest):
def
test_garbage_collection
(
self
):
# C BufferedReader objects are collected.
# The Python version has __del__, so it ends into gc.garbage instead
self
.
addCleanup
(
support
.
unlink
,
support
.
TESTFN
)
with
support
.
check_warnings
((
''
,
ResourceWarning
)):
rawio
=
self
.
FileIO
(
support
.
TESTFN
,
"w+b"
)
f
=
self
.
tp
(
rawio
)
...
...
@@ -1718,6 +1719,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
def
test_truncate
(
self
):
# Truncate implicitly flushes the buffer.
self
.
addCleanup
(
support
.
unlink
,
support
.
TESTFN
)
with
self
.
open
(
support
.
TESTFN
,
self
.
write_mode
,
buffering
=
0
)
as
raw
:
bufio
=
self
.
tp
(
raw
,
8
)
bufio
.
write
(
b
"abcdef"
)
...
...
@@ -1730,6 +1732,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
# Ensure that truncate preserves the file position after
# writes longer than the buffer size.
# Issue: https://bugs.python.org/issue32228
self
.
addCleanup
(
support
.
unlink
,
support
.
TESTFN
)
with
self
.
open
(
support
.
TESTFN
,
"wb"
)
as
f
:
# Fill with some buffer
f
.
write
(
b
'
\x00
'
*
10000
)
...
...
@@ -1851,6 +1854,7 @@ class CBufferedWriterTest(BufferedWriterTest, SizeofTest):
# C BufferedWriter objects are collected, and collecting them flushes
# all data to disk.
# The Python version has __del__, so it ends into gc.garbage instead
self
.
addCleanup
(
support
.
unlink
,
support
.
TESTFN
)
with
support
.
check_warnings
((
''
,
ResourceWarning
)):
rawio
=
self
.
FileIO
(
support
.
TESTFN
,
"w+b"
)
f
=
self
.
tp
(
rawio
)
...
...
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